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

October 26, 2019
Tweet

More Decks by Andrea Ceroni

Other Decks in Programming

Transcript

  1. #DOH19 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. #DOH19 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. #DOH19 Voice command Text to speech wake word triggers listening

    Alexa apri Aldo e deploya DevOpsHeroes N L U Alexa AVS Confermi il deploy di DevOpsHeroes? ... Fulfillment device inactive
  4. #DOH19 Interaction Model Invocation wake word(s) Slots infromazioni necessarie Intents

    cosa volete fare Endpoint logica per creare la risposta
  5. #DOH19 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
  6. #DOH19 Coding the fulfillment Device "Alexa, chiedi ad aldo di

    fare il deploy del progetto DevOpsHeroes" AlexaService Intent: Slot: DeployProject ProjectName, DevOpsHeroes Confermi il deploy del progetto DevOpsHeroes? Text to speech Fulfillment Event request handlers CreatResourceHandler CanHandle() Handle() BuildProjectHandler CanHandle() Handle() DeployProjectHandler CanHandle() Handle() Response ....
  7. #DOH19 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 ...
  8. #DOH19 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
  9. #DOH19 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); } ... }
  10. #DOH19 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); }
  11. #DOH19 Proactive Events 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 https://developer.amazon.com/it/docs/smapi/proactive-events-api.html
  12. #DOH19 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); ... }
  13. #DOH19 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...