Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Alexa, please deploy my Azure architecture

Alexa, please deploy my Azure architecture

Andrea Ceroni

March 22, 2019
Tweet

More Decks by Andrea Ceroni

Other Decks in Programming

Transcript

  1. Why voice DevOps ? sperimentare un modo diverso di fare

    qualcosa di ripetitivo, spesse volte quasi annoiante ma si può parlando? ...ci avete mai pensato? come sarebbe se fosse davvero "frictionless" ?
  2. Aldo (Alexa DevOps) Aldo Project Deployer Azure Aldo Resource Deployer

    Aldo Alexa AVS + ASK Alexa Developer Portal Proactive Events Aldo Notifier (build, deploy) Aldo Project Builder Azure DevOps Pipeline Echo
  3. Voice command Text to speech wake word triggers listening Alexa

    apri Aldo e deploya Codemotion N L U Alexa AVS Confermi il deploy di Codemotion? ... Fulfillment device inactive
  4. Intent intent has many has 0 or more sample utterances

    slot contains 0 or more custom built-in one of type name sample values has a has one has many
  5. Coding the fulfillment Device "Alexa, chiedi ad aldo di fare

    il deploy del progetto Codemotion" AlexaService Intent: Slot: DeployProject ProjectName, Codemotion Confermi il deploy del progetto Codemotion? Text to speech Fulfillment Event request handlres CreatResourceHandler CanHandle() Handle() BuildProjectHandler CanHandle() Handle() DeployProjectHandler CanHandle() Handle() Response ....
  6. Cosa si può fare? Per ora 3 cose ... provisioning

    di un servizio su Azure (app, db, storage...) deploy di un progetto ospitato in Azure DevOps build di un progetto ...
  7. Azure Management Libraries (IaaC) public class AzureFunctionDeployment : BaseDeployment {

    protected override Task ExecuteCreateAsync() { var definition = Azure .WithSubscription(Options.SubscriptionId) .AppServices.FunctionApps .Define(AppName) .WithRegion(Options.Region); var create = definition.WithExistingResourceGroup( Options.ResourceGroupName) return create.CreateAsync(); } } https://github.com/Azure/azure-libraries-for-net
  8. Resource Deployer FunctionName("AldoResourceDeployer")] public async Task Run([QueueTrigger("azure-resource-deploy" ... [Queue("project-deploy" ...)

    { var azure = await azureService.Authenticate(conf.ClientId, conf.ClientSecret, conf.TenantId); var deploy = await deploymentService.Deploy(azure, deployOptions, ard.AzureResource); if(deploy.IsSuccess) { var message = ... await notificationService.SendUserNotification(user,message); } ... }
  9. Project Deployer & Builder FunctionName("AldoProjectDeployer")] public async Task Run([QueueTrigger("project-deploy" ...)]

    ProjectToDeploy pd) { var release = await azureDevOpsService.TriggerRelease(pd); } FunctionName("AldoProjectBuilder")] public async Task Run([QueueTrigger("project-build" ...)] ProjectToBuild pb) { var build = await azureDevOpsService.TriggerBuild(pb); }
  10. Proactive Events https://developer.amazon.com/it/docs/smapi/proactive-events-api.html sostituiscono le notifiche esistono diversi schemi tra

    cui scegliere ma per ora non è possibile definire un proprio evento custom ... possono essere unicast o broadcast tramite l'app Alexa occorre dare consenso alla ricezione
  11. Notifier FunctionName("AldoNotifier")] public async Task Run([HttpTrigger(..."post"...)] HttpRequest req) { ...

    dynamic data = JsonConvert.DeserializeObject(requestBody); string eventType = data.eventType; switch(eventType) { case "ms.vss-release.deployment-completed-event": user = await azureDevOpsService.GetReleaseRequestor(...); message = ... case "build.complete": user = await azureDevOpsService.GetBuildRequestor(...); message = ... } if(user.IsSuccess) await notificationService.SendUserNotification(user,message); ... }
  12. Next account linking per integrarsi pienamente con Azure DevOps e

    personalizzare l'esperienza Durable Function stateful o Akka actor che orchestra gli worker per rendere il flusso più immediato e avere anche altre possibilità aggiungere ulteriori azioni e parametri (nome branch, env...) localizzazione della skill con frasi diverse per le stesse azioni suggerimenti...