%3CLINGO-SUB%20id%3D%22lingo-sub-1592297%22%20slang%3D%22en-US%22%3EAzure%20Integration%20Services%20asynchronous%20pattern%20deployed%20with%20Azure%20DevOps%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1592297%22%20slang%3D%22en-US%22%3E%3CP%3EA%20fully%20automated%20DevOps%20deployment%20of%20an%20asynchronous%20pattern%20with%20Azure%20Integration%20Services.%20Setup%20with%20services%20like%3A%20API%20Management%2C%20Service%20Bus%2C%20Logic%20Apps%2C%20Event%20Grid%2C%20Key%20Vault%20(to%20store%20connections%20strings%20and%20keys%20for%20API%20Connections)%2C%20Cosmos%20DB%2C%20Application%20Insights%20(for%20logging%20and%20monitoring%20API%20Management)%20and%20Log%20Analytics%20(for%20logging%20metrics%20from%20Logic%20Apps).%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%20is%20the%20GitHub%20repository%20with%20all%20resources%20used%20in%20this%20tutorial%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Fpascalvanderheiden%2Fais-async-pattern%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Fpascalvanderheiden%2Fais-async-pattern%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20architecture%20is%20based%20on%20the%20Enterprise%20integration%20with%20queues%20and%20events%3A%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Farchitecture%2Freference-architectures%2Fenterprise-integration%2Fqueues-events%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Farchitecture%2Freference-architectures%2Fenterprise-integration%2Fqueues-events%3C%2FA%3E%3C%2FP%3E%0A%3CP%3EI've%20used%20API%20Management%20GUI%20to%20create%20the%20API.%20And%2C%20I've%20used%20the%20Extract%20Tool%20to%20create%20the%20defnition%20for%20my%20API%3A%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2Fazure-api-management-devops-resource-kit%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2FAzure%2Fazure-api-management-devops-resource-kit%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fblog%2Fbuild-a-ci-cd-pipeline-for-api-management%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fblog%2Fbuild-a-ci-cd-pipeline-for-api-management%2F%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1293576301%22%20id%3D%22toc-hId--1293575594%22%3E%3CA%20id%3D%22user-content-azure-architecture%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fpascalvanderheiden%2Fais-async-pattern%23azure-architecture%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EAzure%20Architecture%3C%2FH2%3E%0A%3CDIV%20id%3D%22tinyMceEditorPascalvdHeiden_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22arch.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F212700i40B1841F99B6B3E2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22arch.png%22%20alt%3D%22arch.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20architecture%20uses%20Logic%20Apps%20to%20orchestrate%20workflows%20and%20API%20Management%20to%20create%20catalogs%20of%20APIs.%20This%20version%20of%20the%20architecture%20adds%20two%20components%20that%20help%20make%20the%20system%20more%20reliable%20and%20scalable%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EAzure%20Service%20Bus.%20Service%20Bus%20is%20a%20secure%2C%20reliable%20message%20broker.%3C%2FLI%3E%0A%3CLI%3EAzure%20Event%20Grid.%20Event%20Grid%20is%20an%20event%20routing%20service.%20It%20uses%20a%20publish%2Fsubscribe%20(pub%2Fsub)%20eventing%20model.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EIn%20this%20case%20I've%20used%20Cosmos%20DB%20to%20store%20the%20message%2C%20but%20this%20can%20be%20replace%20with%20any%20backend%20application.%3C%2FP%3E%0A%3CP%3EIn%20DevOps%20with%20the%20build%20pipeline%20all%20shared%20resources%20are%20deployed.%20The%20release%20pipeline%20deploys%20the%20specific%20services%20needed%20for%20this%20pattern.%20In%20this%20way%20are%20able%20to%20deploy%2C%20by%20cloning%2C%20multiple%20async%20pattern%2C%20using%20the%20same%20shared%20components%20for%20cost%20optimization.%3C%2FP%3E%0A%3CP%3EAsynchronous%20communication%20using%20a%20message%20broker%20provides%20a%20number%20of%20advantages%20over%20making%20direct%2C%20synchronous%20calls%20to%20backend%20services%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EProvides%20load-leveling%20to%20handle%20bursts%20in%20workloads%2C%20using%20the%20Queue-Based%20Load%20Leveling%20pattern.%3C%2FLI%3E%0A%3CLI%3EReliably%20tracks%20the%20progress%20of%20long-running%20workflows%20that%20involve%20multiple%20steps%20or%20multiple%20applications.%3C%2FLI%3E%0A%3CLI%3EHelps%20to%20decouple%20applications.%3C%2FLI%3E%0A%3CLI%3EIntegrates%20with%20existing%20message-based%20systems.%3C%2FLI%3E%0A%3CLI%3EAllows%20work%20to%20be%20queued%20when%20a%20backend%20system%20is%20not%20available.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1193936532%22%20id%3D%22toc-hId-1193937239%22%3E%3CA%20id%3D%22user-content-step-by-step-installation%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fpascalvanderheiden%2Fais-async-pattern%23step-by-step-installation%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EStep%20by%20Step%20installation%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1884498006%22%20id%3D%22toc-hId-1884498713%22%3E%3CA%20id%3D%22user-content-step-1-in-the-azure-portal-create-a-service-principal%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fpascalvanderheiden%2Fais-async-pattern%23step-1-in-the-azure-portal-create-a-service-principal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EStep%201%3A%20In%20the%20Azure%20Portal%20create%20a%20Service%20Principal%3C%2FH3%3E%0A%3CP%3EIn%20the%20Azure%20Cloud%20Shell%20(%3CA%20href%3D%22https%3A%2F%2Fshell.azure.com%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fshell.azure.com)%3C%2FA%3E%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3Eaz%20ad%20sp%20create-for-rbac%20--name%20%5Byour-service-principal-name%5D%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3ECopy%20the%20JSON%20Output!%20We'll%20be%20needing%20this%20information%20to%20create%20the%20service%20connection%20in%20Azure%20DevOps.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-77043543%22%20id%3D%22toc-hId-77044250%22%3E%3CA%20id%3D%22user-content-step-2-generate-your-azure-devops-project-for-continuous-integration--deployment-with-the-azure-devops-generator%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fpascalvanderheiden%2Fais-async-pattern%23step-2-generate-your-azure-devops-project-for-continuous-integration--deployment-with-the-azure-devops-generator%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EStep%202%3A%20Generate%20your%20Azure%20DevOps%20Project%20for%20Continuous%20Integration%20%26amp%3B%20Deployment%20with%20the%20Azure%20DevOps%20Generator%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3EIn%20the%20devops%20folder%20of%20this%20repo%20the%20Azure%20DevOps%20template%20is%20included.%20Download%20it.%3C%2FLI%3E%0A%3CLI%3ELogin%20with%20your%20account%20and%20open%20the%20DevOps%20Generator%3A%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fazuredevopsdemogenerator.azurewebsites.net%2Fenvironment%2Fcreateproject%3Fenableextractor%3Dtrue%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fazuredevopsdemogenerator.azurewebsites.net%2Fenvironment%2Fcreateproject%3Fenableextractor%3Dtrue%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EChoose%20a%20custom%20template%20and%20point%20to%20the%20zip-file%20in%20the%20devops%20folder.%20This%20repo%20will%20be%20imported%20into%20Azure%20DevOps%20and%20Pipelines%20are%20created%20for%20you.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThe%20project%20is%20split-up%20into%202%20pieces%3B%20shared%20resources%20%26amp%3B%20integration%20specific%20resources.%20Enabling%20you%20to%20extend%20your%20project%20with%20more%20integration%20and%20re-using%20the%20shared%20resources%20for%20cost%20efficiency.%3C%2FP%3E%0A%3CP%3EYou%20can%20find%20the%20documentation%20on%20the%20Azure%20DevOps%20Generator%20here%3A%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fvstsdemodata.visualstudio.com%2FAzureDevOpsDemoGenerator%2F_wiki%2Fwikis%2FAzureDevOpsGenerator.wiki%2F58%2FBuild-your-own-template%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fvstsdemodata.visualstudio.com%2FAzureDevOpsDemoGenerator%2F_wiki%2Fwikis%2FAzureDevOpsGenerator.wiki%2F58%2FBuild-your-own-template%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1730410920%22%20id%3D%22toc-hId--1730410213%22%3E%3CA%20id%3D%22user-content-step-3-in-azure-devops-create-a-service-connection%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fpascalvanderheiden%2Fais-async-pattern%23step-3-in-azure-devops-create-a-service-connection%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EStep%203%3A%20In%20Azure%20DevOps%2C%20create%20a%20service%20connection%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3ELogin%20with%20your%20account%20Azure%20DevOps.%20Go%20to%20the%20Project%20Settings%20of%20the%20DevOps%20Project%20you've%20created%20in%20step%202.%3C%2FLI%3E%0A%3CLI%3EGo%20to%20Service%20Connections*.%3C%2FLI%3E%0A%3CLI%3ECreate%20a%20new%20service%20connection%2C%20choose%20Azure%20Resource%20Manager%2C%20next.%3C%2FLI%3E%0A%3CLI%3ESelect%20Service%20Principal%20(manual).%3C%2FLI%3E%0A%3CLI%3EFill%20in%20the%20Subscription%20Id%2C%20Subscription%20Name.%3C%2FLI%3E%0A%3CLI%3ECopy%20the%20appId%20from%20step%201%20in%20%22Service%20Principal%20Id%22%20and%20the%20password%20from%20step%201%20in%20%22Service%20Principal%20key%22.%20Give%20the%20service%20connection%20a%20name%20and%20verify%20the%20connection.%3C%2FLI%3E%0A%3CLI%3ETick%20%22Grant%20access%20permission%20to%20all%20pipelines.%20Save.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-757101913%22%20id%3D%22toc-hId-757102620%22%3E%3CA%20id%3D%22user-content-step-4-in-azure-devops-update-the-variables-group%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fpascalvanderheiden%2Fais-async-pattern%23step-4-in-azure-devops-update-the-variables-group%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EStep%204%3A%20In%20Azure%20DevOps%2C%20update%20the%20Variables%20Group.%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3EGo%20to%20Pipelines%2C%20Library.%20Click%20on%20the%20Variable%20group%20%22Shared%20Resources%22.%3C%2FLI%3E%0A%3CLI%3ETick%20%22Allow%20access%20to%20all%20pipelines.%3C%2FLI%3E%0A%3CLI%3EUpdate%20the%20values%20of%20the%20variables%20to%20match%20your%20naming%20conventions%20needs.%20I've%20put%20in%20some%20generic%20naming%2C%20but%20you%20need%20to%20update%20the%20variables.%20Otherwise%2C%20the%20creation%20of%20some%20services%20will%20fail%2C%20because%20they've%20been%20already%20used.%3C%2FLI%3E%0A%3CLI%3EThe%20variable%20%22KVCOSMOSDBLABEL%22%20and%20%22KVSERVICEBUSLABEL%22%20are%20used%20as%20labels%20for%20Key%20Vault%20to%20retrieve%20the%20connection%20string%20and%20key%20for%20API%20Connections.%20Leave%20that%20as%20it%20is%3A%20%22aissharedcosmosdb%22%20and%20%22aissharedservicebus%22%3C%2FLI%3E%0A%3CLI%3EDon't%20forget%20to%20save.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1050352550%22%20id%3D%22toc-hId--1050351843%22%3E%3CA%20id%3D%22user-content-step-5-in-azure-devops-update-the-build-pipeline-and-run-it%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fpascalvanderheiden%2Fais-async-pattern%23step-5-in-azure-devops-update-the-build-pipeline-and-run-it%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EStep%205%3A%20In%20Azure%20DevOps%2C%20update%20the%20Build%20pipeline%20and%20Run%20it.%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3EGo%20to%20Pipelines%2C%20Pipelines.%3C%2FLI%3E%0A%3CLI%3ESelect%20%22Build%20Azure%20Integration%20Services%20shared%20resources-CI%22%2C%20Edit.%3C%2FLI%3E%0A%3CLI%3EIn%20Tasks%2C%20select%20the%20Tasks%20which%20have%20the%20explaination%20mark%20%22Some%20settings%20need%20attention%22%2C%20and%20update%20Azure%20Subscription%20to%20your%20Service%20Principal%20Connection.%3C%2FLI%3E%0A%3CLI%3EIn%20Variables%2C%20update%20the%20variables%20to%20match%20your%20naming%20conventions%20needs.%20Keep%20in%20mind%20to%20pick%20unique%20naming%20for%20exposed%20services.%20I've%20put%20in%20some%20generic%20naming%2C%20but%20you%20need%20to%20update%20the%20variables.%20Otherwise%2C%20the%20creation%20of%20some%20services%20will%20fail%2C%20because%20they've%20been%20already%20used.%3C%2FLI%3E%0A%3CLI%3ESave%20%26amp%3B%20queue.%3C%2FLI%3E%0A%3CLI%3EClick%20the%20Agent%20Job%20to%20check%20the%20progress.%20Check%20if%20everything%20is%20create%20correctly%2C%20because%20of%20the%20unique%20naming%20for%20some%20services.%20And%20because%20it's%20fun%20%3A)%3C%2Fimg%3E%3C%2FLI%3E%0A%3CLI%3EKeep%20in%20mind%20that%20the%20CLI%20scripts%20will%20check%20if%20the%20resource%20is%20already%20created%2C%20before%20creating.%20I've%20used%20an%20ARM%20Template%20for%20the%20deployment%20of%20the%20Application%20Insights%2C%20because%20I%20wanted%20to%20automatically%20integrate%20it%20with%20the%20API%20Management%20Instance%20I've%20just%20created.%20This%20is%20not%20yet%20supported%20in%20AZ%20CLI.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-1437160283%22%20id%3D%22toc-hId-1437160990%22%3E%3CA%20id%3D%22user-content-step-6-in-azure-devops-add-the-key-vault-secret-to-the-variables%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fpascalvanderheiden%2Fais-async-pattern%23step-6-in-azure-devops-add-the-key-vault-secret-to-the-variables%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EStep%206%3A%20In%20Azure%20DevOps%2C%20add%20the%20Key%20Vault%20secret%20to%20the%20variables.%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3EGo%20to%20Pipelines%2C%20Library.%20Add%20Variable%20group.%20Give%20it%20a%20name%2C%20something%20like%20%22Key%20Vault%20Secrets%22.%3C%2FLI%3E%0A%3CLI%3ETick%20%22Allow%20access%20to%20all%20pipelines.%3C%2FLI%3E%0A%3CLI%3ETick%20%22Link%20secrets%20from%20an%20Azure%20key%20vault%20as%20variables%22.%3C%2FLI%3E%0A%3CLI%3EUpdate%20the%20Azure%20Subscription%20to%20your%20Service%20Principal%20Connection.%3C%2FLI%3E%0A%3CLI%3ESelect%20the%20Key%20vault%20name.%20If%20your%20build%20pipeline%20ran%20succesfully%2C%20you%20can%20select%20your%20Key%20vault.%20Add%20variables%2C%20and%20it%20will%20popup%20with%20the%20secrets%20we've%20created%20earlier%3A%20%22aissharedcosmosdb%22%20and%20%22aissharedservicebus%22.%20Select%20it%20one%20by%20one%2C%20OK.%20And%20Save.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--370294180%22%20id%3D%22toc-hId--370293473%22%3E%3CA%20id%3D%22user-content-step-7-in-azure-devops-update-the-release-pipeline-and-run-it%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fpascalvanderheiden%2Fais-async-pattern%23step-7-in-azure-devops-update-the-release-pipeline-and-run-it%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EStep%207%3A%20In%20Azure%20DevOps%2C%20update%20the%20Release%20pipeline%20and%20Run%20it.%3C%2FH3%3E%0A%3CUL%3E%0A%3CLI%3EGo%20to%20Pipelines%2C%20Releases.%20Note.%20Because%20I've%20enabled%20continuous%20deployment%20in%20my%20template%2C%20there%20is%20a%20failed%20release%20there%20already.%20You%20can%20ignore%20that%2C%20because%20we%20are%20going%20to%20fix%20the%20release%20in%20the%20step.%3C%2FLI%3E%0A%3CLI%3ESelect%20%22Release%20Azure%20Integration%20Services%20async%20pattern-CD%22%2C%20Edit.%3C%2FLI%3E%0A%3CLI%3EIn%20Tasks%2C%20select%20the%20Tasks%20which%20have%20the%20explanation%20mark%20%22Some%20settings%20need%20attention%22%2C%20and%20update%20Azure%20Subscription%20to%20your%20Service%20Principal%20Connection.%3C%2FLI%3E%0A%3CLI%3EIn%20Variables%2C%20update%20the%20variables%20to%20match%20the%20naming%20you%20used%20in%20the%20Build%20pipeline.%3C%2FLI%3E%0A%3CLI%3EIn%20Variables%20groups%2C%20link%20the%20%22Key%20Vault%20Secrets%22%20variable%20group%2C%20by%20clicking%20the%20Link%20button.%3C%2FLI%3E%0A%3CLI%3ESave%20%26amp%3B%20Create%20Release.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-2117218653%22%20id%3D%22toc-hId-2117219360%22%3E%3CA%20id%3D%22user-content-step-8-go-to-your-api-management-instance-and-test-the-api%22%20class%3D%22anchor%22%20href%3D%22https%3A%2F%2Fgithub.com%2Fpascalvanderheiden%2Fais-async-pattern%23step-8-go-to-your-api-management-instance-and-test-the-api%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%20aria-hidden%3D%22true%22%3E%3C%2FA%3EStep%208%3A%20Go%20to%20your%20API%20Management%20Instance%20and%20test%20the%20API%3C%2FH3%3E%0A%3CP%3EIn%20the%20Azure%20Portal%2C%20just%20go%20to%20API%20Management%2C%20APIs%2C%20click%20your%20new%20API%20(Customer)%2C%20Click%20the%20operation%20POST%20and%20click%20the%20tab%20%22Test%22.%20Past%20the%20sample%20json%20(in%20this%20repo%2C%20sample-request.json)%20into%20the%20request%20body%20and%20click%20Send.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1592297%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EA%20fully%20automated%20DevOps%20deployment%20of%20an%20asynchronous%20pattern%20with%20Azure%20Integration%20Services.%20Setup%20with%20services%20like%3A%20API%20Management%2C%20Service%20Bus%2C%20Logic%20Apps%2C%20Event%20Grid%2C%20Key%20Vault%20(to%20store%20connections%20strings%20and%20keys%20for%20API%20Connections)%2C%20Cosmos%20DB%2C%20Application%20Insights%20(for%20logging%20and%20monitoring%20API%20Management)%20and%20Log%20Analytics%20(for%20logging%20metrics%20from%20Logic%20Apps).%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22arch.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F212700i40B1841F99B6B3E2%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22arch.png%22%20alt%3D%22arch.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1592297%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAPI%20Management%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EApps%20%26amp%3B%20DevOps%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EArchitecture%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EIntegration%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

A fully automated DevOps deployment of an asynchronous pattern with Azure Integration Services. Setup with services like: API Management, Service Bus, Logic Apps, Event Grid, Key Vault (to store connections strings and keys for API Connections), Cosmos DB, Application Insights (for logging and monitoring API Management) and Log Analytics (for logging metrics from Logic Apps).

 

Here is the GitHub repository with all resources used in this tutorial: https://github.com/pascalvanderheiden/ais-async-pattern

 

The architecture is based on the Enterprise integration with queues and events: https://docs.microsoft.com/en-us/azure/architecture/reference-architectures/enterprise-integration/q...

I've used API Management GUI to create the API. And, I've used the Extract Tool to create the defnition for my API: https://github.com/Azure/azure-api-management-devops-resource-kit

https://azure.microsoft.com/en-us/blog/build-a-ci-cd-pipeline-for-api-management/

 

Azure Architecture

 

arch.png

 

The architecture uses Logic Apps to orchestrate workflows and API Management to create catalogs of APIs. This version of the architecture adds two components that help make the system more reliable and scalable:

  • Azure Service Bus. Service Bus is a secure, reliable message broker.
  • Azure Event Grid. Event Grid is an event routing service. It uses a publish/subscribe (pub/sub) eventing model.

In this case I've used Cosmos DB to store the message, but this can be replace with any backend application.

In DevOps with the build pipeline all shared resources are deployed. The release pipeline deploys the specific services needed for this pattern. In this way are able to deploy, by cloning, multiple async pattern, using the same shared components for cost optimization.

Asynchronous communication using a message broker provides a number of advantages over making direct, synchronous calls to backend services:

  • Provides load-leveling to handle bursts in workloads, using the Queue-Based Load Leveling pattern.
  • Reliably tracks the progress of long-running workflows that involve multiple steps or multiple applications.
  • Helps to decouple applications.
  • Integrates with existing message-based systems.
  • Allows work to be queued when a backend system is not available.

 

Step by Step installation

 

Step 1: In the Azure Portal create a Service Principal

In the Azure Cloud Shell (https://shell.azure.com)

  • az ad sp create-for-rbac --name [your-service-principal-name]

Copy the JSON Output! We'll be needing this information to create the service connection in Azure DevOps.

 

Step 2: Generate your Azure DevOps Project for Continuous Integration & Deployment with the Azure DevOps Generator

The project is split-up into 2 pieces; shared resources & integration specific resources. Enabling you to extend your project with more integration and re-using the shared resources for cost efficiency.

You can find the documentation on the Azure DevOps Generator here: https://vstsdemodata.visualstudio.com/AzureDevOpsDemoGenerator/_wiki/wikis/AzureDevOpsGenerator.wiki...

 

Step 3: In Azure DevOps, create a service connection

  • Login with your account Azure DevOps. Go to the Project Settings of the DevOps Project you've created in step 2.
  • Go to Service Connections*.
  • Create a new service connection, choose Azure Resource Manager, next.
  • Select Service Principal (manual).
  • Fill in the Subscription Id, Subscription Name.
  • Copy the appId from step 1 in "Service Principal Id" and the password from step 1 in "Service Principal key". Give the service connection a name and verify the connection.
  • Tick "Grant access permission to all pipelines. Save.

 

Step 4: In Azure DevOps, update the Variables Group.

  • Go to Pipelines, Library. Click on the Variable group "Shared Resources".
  • Tick "Allow access to all pipelines.
  • Update the values of the variables to match your naming conventions needs. I've put in some generic naming, but you need to update the variables. Otherwise, the creation of some services will fail, because they've been already used.
  • The variable "KVCOSMOSDBLABEL" and "KVSERVICEBUSLABEL" are used as labels for Key Vault to retrieve the connection string and key for API Connections. Leave that as it is: "aissharedcosmosdb" and "aissharedservicebus"
  • Don't forget to save.

 

Step 5: In Azure DevOps, update the Build pipeline and Run it.

  • Go to Pipelines, Pipelines.
  • Select "Build Azure Integration Services shared resources-CI", Edit.
  • In Tasks, select the Tasks which have the explaination mark "Some settings need attention", and update Azure Subscription to your Service Principal Connection.
  • In Variables, update the variables to match your naming conventions needs. Keep in mind to pick unique naming for exposed services. I've put in some generic naming, but you need to update the variables. Otherwise, the creation of some services will fail, because they've been already used.
  • Save & queue.
  • Click the Agent Job to check the progress. Check if everything is create correctly, because of the unique naming for some services. And because it's fun :)
  • Keep in mind that the CLI scripts will check if the resource is already created, before creating. I've used an ARM Template for the deployment of the Application Insights, because I wanted to automatically integrate it with the API Management Instance I've just created. This is not yet supported in AZ CLI.

 

Step 6: In Azure DevOps, add the Key Vault secret to the variables.

  • Go to Pipelines, Library. Add Variable group. Give it a name, something like "Key Vault Secrets".
  • Tick "Allow access to all pipelines.
  • Tick "Link secrets from an Azure key vault as variables".
  • Update the Azure Subscription to your Service Principal Connection.
  • Select the Key vault name. If your build pipeline ran succesfully, you can select your Key vault. Add variables, and it will popup with the secrets we've created earlier: "aissharedcosmosdb" and "aissharedservicebus". Select it one by one, OK. And Save.

 

Step 7: In Azure DevOps, update the Release pipeline and Run it.

  • Go to Pipelines, Releases. Note. Because I've enabled continuous deployment in my template, there is a failed release there already. You can ignore that, because we are going to fix the release in the step.
  • Select "Release Azure Integration Services async pattern-CD", Edit.
  • In Tasks, select the Tasks which have the explanation mark "Some settings need attention", and update Azure Subscription to your Service Principal Connection.
  • In Variables, update the variables to match the naming you used in the Build pipeline.
  • In Variables groups, link the "Key Vault Secrets" variable group, by clicking the Link button.
  • Save & Create Release.

 

Step 8: Go to your API Management Instance and test the API

In the Azure Portal, just go to API Management, APIs, click your new API (Customer), Click the operation POST and click the tab "Test". Past the sample json (in this repo, sample-request.json) into the request body and click Send.