Alexa, please deploy my Azure architecture

Alexa, please deploy my Azure architecture

620f273615fdcc07fb2c4d3b72a1bf09?s=128

Andrea Ceroni

October 26, 2019
Tweet

Transcript

  1. #DOH19

  2. Alexa, please deploy my Azure architecture Andrea Ceroni @andrekiba6 andrea.ceroni@elfo.net

    andrea.ceroni@gmail.com http://www.klabcommunity.org http://www.elfo.net
  3. #DOH19 KLab

  4. #DOH19 Organizer & sponsors GetLatestVersion.it

  5. #DOH19 Alexa + Azure = voice DevOps

  6. #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" ?
  7. #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
  8. #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
  9. #DOH19 Alexa Developer Console

  10. #DOH19 Interaction Model Invocation wake word(s) Slots infromazioni necessarie Intents

    cosa volete fare Endpoint logica per creare la risposta
  11. #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
  12. #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 ....
  13. #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 ...
  14. #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
  15. #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); } ... }
  16. #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); }
  17. #DOH19 Azure DevOps Pipelines

  18. #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
  19. #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); ... }
  20. #DOH19 Azure DevOps API docs.microsoft.com/en-us/rest/api/azure/devops/?view=azure-devops-rest-5.0

  21. #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...
  22. #DOH19 Q&A HandleQuestionIntent(IntentRequest request) { if(iKnowTheAnswerJ) return ResponseBuilder.Tell(Answer); return ResponseBuilder.Empty()

    ; }
  23. #DOH19 THANK YOU!