├── .gitignore ├── CODE_OF_CONDUCT.md ├── LICENSE ├── PIPELINE_PAYLOAD.md ├── README.md ├── SECURITY.md ├── azuredeploy.json ├── resources ├── Diagrams.pptx ├── arm-edit-api.png ├── devops-edit-api.png ├── get-url-from-app.png ├── video-thumbprint.png ├── workflow.png └── workflow.vsdx └── samples ├── instance-two.json ├── just-the-base.json ├── second-instance.json └── the-whole-kit.json /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015/2017 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # Visual Studio 2017 auto generated files 33 | Generated\ Files/ 34 | 35 | # MSTest test Results 36 | [Tt]est[Rr]esult*/ 37 | [Bb]uild[Ll]og.* 38 | 39 | # NUNIT 40 | *.VisualState.xml 41 | TestResult.xml 42 | 43 | # Build Results of an ATL Project 44 | [Dd]ebugPS/ 45 | [Rr]eleasePS/ 46 | dlldata.c 47 | 48 | # Benchmark Results 49 | BenchmarkDotNet.Artifacts/ 50 | 51 | # .NET Core 52 | project.lock.json 53 | project.fragment.lock.json 54 | artifacts/ 55 | **/Properties/launchSettings.json 56 | 57 | # StyleCop 58 | StyleCopReport.xml 59 | 60 | # Files built by Visual Studio 61 | *_i.c 62 | *_p.c 63 | *_i.h 64 | *.ilk 65 | *.meta 66 | *.obj 67 | *.iobj 68 | *.pch 69 | *.pdb 70 | *.ipdb 71 | *.pgc 72 | *.pgd 73 | *.rsp 74 | *.sbr 75 | *.tlb 76 | *.tli 77 | *.tlh 78 | *.tmp 79 | *.tmp_proj 80 | *.log 81 | *.vspscc 82 | *.vssscc 83 | .builds 84 | *.pidb 85 | *.svclog 86 | *.scc 87 | 88 | # Chutzpah Test files 89 | _Chutzpah* 90 | 91 | # Visual C++ cache files 92 | ipch/ 93 | *.aps 94 | *.ncb 95 | *.opendb 96 | *.opensdf 97 | *.sdf 98 | *.cachefile 99 | *.VC.db 100 | *.VC.VC.opendb 101 | 102 | # Visual Studio profiler 103 | *.psess 104 | *.vsp 105 | *.vspx 106 | *.sap 107 | 108 | # Visual Studio Trace Files 109 | *.e2e 110 | 111 | # TFS 2012 Local Workspace 112 | $tf/ 113 | 114 | # Guidance Automation Toolkit 115 | *.gpState 116 | 117 | # ReSharper is a .NET coding add-in 118 | _ReSharper*/ 119 | *.[Rr]e[Ss]harper 120 | *.DotSettings.user 121 | 122 | # JustCode is a .NET coding add-in 123 | .JustCode 124 | 125 | # TeamCity is a build add-in 126 | _TeamCity* 127 | 128 | # DotCover is a Code Coverage Tool 129 | *.dotCover 130 | 131 | # AxoCover is a Code Coverage Tool 132 | .axoCover/* 133 | !.axoCover/settings.json 134 | 135 | # Visual Studio code coverage results 136 | *.coverage 137 | *.coveragexml 138 | 139 | # NCrunch 140 | _NCrunch_* 141 | .*crunch*.local.xml 142 | nCrunchTemp_* 143 | 144 | # MightyMoose 145 | *.mm.* 146 | AutoTest.Net/ 147 | 148 | # Web workbench (sass) 149 | .sass-cache/ 150 | 151 | # Installshield output folder 152 | [Ee]xpress/ 153 | 154 | # DocProject is a documentation generator add-in 155 | DocProject/buildhelp/ 156 | DocProject/Help/*.HxT 157 | DocProject/Help/*.HxC 158 | DocProject/Help/*.hhc 159 | DocProject/Help/*.hhk 160 | DocProject/Help/*.hhp 161 | DocProject/Help/Html2 162 | DocProject/Help/html 163 | 164 | # Click-Once directory 165 | publish/ 166 | 167 | # Publish Web Output 168 | *.[Pp]ublish.xml 169 | *.azurePubxml 170 | # Note: Comment the next line if you want to checkin your web deploy settings, 171 | # but database connection strings (with potential passwords) will be unencrypted 172 | *.pubxml 173 | *.publishproj 174 | 175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 176 | # checkin your Azure Web App publish settings, but sensitive information contained 177 | # in these scripts will be unencrypted 178 | PublishScripts/ 179 | 180 | # NuGet Packages 181 | *.nupkg 182 | # The packages folder can be ignored because of Package Restore 183 | **/[Pp]ackages/* 184 | # except build/, which is used as an MSBuild target. 185 | !**/[Pp]ackages/build/ 186 | # Uncomment if necessary however generally it will be regenerated when needed 187 | #!**/[Pp]ackages/repositories.config 188 | # NuGet v3's project.json files produces more ignorable files 189 | *.nuget.props 190 | *.nuget.targets 191 | 192 | # Microsoft Azure Build Output 193 | csx/ 194 | *.build.csdef 195 | 196 | # Microsoft Azure Emulator 197 | ecf/ 198 | rcf/ 199 | 200 | # Windows Store app package directories and files 201 | AppPackages/ 202 | BundleArtifacts/ 203 | Package.StoreAssociation.xml 204 | _pkginfo.txt 205 | *.appx 206 | 207 | # Visual Studio cache files 208 | # files ending in .cache can be ignored 209 | *.[Cc]ache 210 | # but keep track of directories ending in .cache 211 | !*.[Cc]ache/ 212 | 213 | # Others 214 | ClientBin/ 215 | ~$* 216 | *~ 217 | *.dbmdl 218 | *.dbproj.schemaview 219 | *.jfm 220 | *.pfx 221 | *.publishsettings 222 | orleans.codegen.cs 223 | 224 | # Including strong name files can present a security risk 225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 226 | #*.snk 227 | 228 | # Since there are multiple workflows, uncomment next line to ignore bower_components 229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 230 | #bower_components/ 231 | 232 | # RIA/Silverlight projects 233 | Generated_Code/ 234 | 235 | # Backup & report files from converting an old project file 236 | # to a newer Visual Studio version. Backup files are not needed, 237 | # because we have git ;-) 238 | _UpgradeReport_Files/ 239 | Backup*/ 240 | UpgradeLog*.XML 241 | UpgradeLog*.htm 242 | ServiceFabricBackup/ 243 | *.rptproj.bak 244 | 245 | # SQL Server files 246 | *.mdf 247 | *.ldf 248 | *.ndf 249 | 250 | # Business Intelligence projects 251 | *.rdl.data 252 | *.bim.layout 253 | *.bim_*.settings 254 | *.rptproj.rsuser 255 | 256 | # Microsoft Fakes 257 | FakesAssemblies/ 258 | 259 | # GhostDoc plugin setting file 260 | *.GhostDoc.xml 261 | 262 | # Node.js Tools for Visual Studio 263 | .ntvs_analysis.dat 264 | node_modules/ 265 | 266 | # Visual Studio 6 build log 267 | *.plg 268 | 269 | # Visual Studio 6 workspace options file 270 | *.opt 271 | 272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 273 | *.vbw 274 | 275 | # Visual Studio LightSwitch build output 276 | **/*.HTMLClient/GeneratedArtifacts 277 | **/*.DesktopClient/GeneratedArtifacts 278 | **/*.DesktopClient/ModelManifest.xml 279 | **/*.Server/GeneratedArtifacts 280 | **/*.Server/ModelManifest.xml 281 | _Pvt_Extensions 282 | 283 | # Paket dependency manager 284 | .paket/paket.exe 285 | paket-files/ 286 | 287 | # FAKE - F# Make 288 | .fake/ 289 | 290 | # JetBrains Rider 291 | .idea/ 292 | *.sln.iml 293 | 294 | # CodeRush 295 | .cr/ 296 | 297 | # Python Tools for Visual Studio (PTVS) 298 | __pycache__/ 299 | *.pyc 300 | 301 | # Cake - Uncomment if you are using it 302 | # tools/** 303 | # !tools/packages.config 304 | 305 | # Tabs Studio 306 | *.tss 307 | 308 | # Telerik's JustMock configuration file 309 | *.jmconfig 310 | 311 | # BizTalk build output 312 | *.btp.cs 313 | *.btm.cs 314 | *.odx.cs 315 | *.xsd.cs 316 | 317 | # OpenCover UI analysis results 318 | OpenCover/ 319 | 320 | # Azure Stream Analytics local run output 321 | ASALocalRun/ 322 | 323 | # MSBuild Binary and Structured Log 324 | *.binlog 325 | 326 | # NVidia Nsight GPU debugger configuration file 327 | *.nvuser 328 | 329 | # MFractors (Xamarin productivity tool) working folder 330 | .mfractor/ 331 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Microsoft Open Source Code of Conduct 2 | 3 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 4 | 5 | Resources: 6 | 7 | - [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/) 8 | - [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) 9 | - Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns 10 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Microsoft Corporation. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE 22 | -------------------------------------------------------------------------------- /PIPELINE_PAYLOAD.md: -------------------------------------------------------------------------------- 1 | # Pipeline Orchestration Payload 2 | 3 | This will describe the structure of the payload to send to the Pipeline Orchestration Logic App created using this sample. 4 | 5 | ## Multistage Pipeline Orchestration Definition 6 | 7 | | Field Name | Required | Type | Description | 8 | |-------------------------|----------|--------------------------|----------------------------------------------------------------------| 9 | | organization | yes | string | The name of the Azure DevOps organization that the pipelines are located in. | 10 | | project | yes | string | The name of the project within the Azure DevOps organization that the pipelines are located in. | 11 | | azureSubscriptionId | no* | string | The subscription id that will be used to test if ARM deployments are completed.| 12 | | location | no* | string | Used to construct the resource group name to valid successful deployment. ** | 13 | | workGroupId | no* | string | Used to construct the resource group name to valid successful deployment. ** | 14 | | environment | no* | string | Used to construct the resource group name to valid successful deployment. ** | 15 | | primarySyncPipelines | yes*** | array[PrimaryPipeline] | Defines the pipelines that will execute one at a time, prior to the secondary pipelines being executed. | 16 | | secondaryAsyncPipelines | yes*** | array[SecondaryPipeline] | Defines the pieplines that will be executed concurrently after all of the primary pipelines have completed | 17 | 18 | * Required only when using resource group style validation of the primary Sync Pipelines 19 | ** Edits to the "Set dynamic resource group name" action of the logic app can be made to accomidiate your organizations resource group naming conventions. The sample uses "workGroupId"-"location"-"environment"-"value passed into the resourceGroupName field of the pipeline" 20 | *** An empty array can be provided, but an array does need to be defined 21 | 22 | ## Primary Pipeline 23 | 24 | | Field Name | Required | Type | Description | 25 | |----------------------------------|----------|--------------------------|-------------| 26 | | path | yes | string | The path the pipeline is stored within Azure DevOps Pieplines. | 27 | | name | yes | string | The name of the pipeline to execute. | 28 | | branch | yes | string | The name of the branch to execute the pipeline against. | 29 | | validationType | yes | string | The type of validation that will be performed to ensure the pipeline is complete. Options are "pipeline" which will wait until the build reaches a completed state or "resourceGroup" which will wait for the deployment to complete within the resourceGroup defined (helpful for very long running pipelines). | 30 | | resourceGroupName | no* | string | Used to construct the resource group name, or is the complete resrouce group name, depending on the state of the useResourceGroupNamingConvention indeicator | 31 | | useResourceGroupNamingConvention | no* | boolean | Identifies whether the naming convention will be used to construct the resource group name, or the value passed into the resourceGroupName field | 32 | | parameters | yes* | array[Parameters] | Parameter values to pass into the Azure DevOps pipelines. | 33 | 34 | * Required only when using resource group style validation of the primary Sync Pipelines 35 | ** An empty array can be provided, but an array does need to be defined 36 | 37 | ## Secondary Pipeline 38 | 39 | | Field Name | Required | Type | Description | 40 | |----------------------------------|----------|--------------------------|-------------| 41 | | path | yes | string | The path the pipeline is stored within Azure DevOps Pipelines. | 42 | | name | yes | string | The name of the pipeline to execute. | 43 | | branch | yes | string | The name of the branch to execute the pipeline against. | 44 | | parameters | yes* | array[Parameters] | Parameter values to pass into the Azure DevOps pipelines. | 45 | 46 | * An empty array can be provided, but an array does need to be defined 47 | 48 | ## Parameters 49 | 50 | | Field Name | Required | Type | Description | 51 | |----------------------------------|----------|--------------------------|-------------| 52 | | name | yes | string | The name of the parameters. Should match the name of the variable defined/used within the pipeline | 53 | | value | yes | string | The value of the parameter. | 54 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | --- 2 | page_type: sample 3 | languages: 4 | - json 5 | products: 6 | - azure-logic-apps 7 | - azure-devops 8 | description: "This sample provides an Azure Resource Manager template for an Azure Logic app that can be used to orchestrate the execution of many Azure DevOps Pipelines." 9 | urlFragment: azure-devops-orchestration-with-logic-apps 10 | --- 11 | 12 | # Using Azure Logic Apps for Azure DevOps Pipeline Orchestration 13 | 14 | This sample provides an Azure Resource Manager template for a Azure Logic app that can be used to orchestrate the execution of many Azure DevOps Pipelines. The Logic App is an HTTP triggered logic app that accepts a POST method. The payload has two arrays defined. The first array is the information for the pipelines that will need to be executed synchronously. The second is the information on the pipelines that, once the synchronous pipelines are completed, can be executed asynchronously. 15 | 16 | Demo video of this Azure Logic App: 17 | 18 | [![Click to view video that demonstrates this azure logic app sample](./resources/video-thumbprint.png)](https://youtu.be/X5AvsAMEiQM) 19 | 20 | > The Azure DevOps project that is being used for this demo can be located here: [Azure DevOps Orchestration with Azure Logic Apps sample pipeline](https://dev.azure.com/shgaul/LogicAppsAndDevOps) 21 | 22 | 23 | ## Contents 24 | 25 | | File/folder | Description | 26 | |-------------------|---------------------------------------------------------| 27 | | `samples` | Sample payloads that are sent to the app for execution. | 28 | | `azuredeploy.json`| The Azure Resource Manager template that contains the sample application. | 29 | | `.gitignore` | Define what to ignore at commit time. | 30 | | `README.md` | This README file. | 31 | | `LICENSE` | The license for the sample. | 32 | | `SECURITY` | Microsoft OOS Security disclosure. | 33 | | `CODE_OF_CONDUCT` | Microsoft OOS code of conduct. | 34 | 35 | ## Prerequisites 36 | 37 | * Azure subscription 38 | * Azure DevOps subscription 39 | * Azure DevOps Pipelines defined 40 | 41 | ## Setup 42 | 43 | To setup this sample execute the follow steps in order. 44 | 45 | * Create a resource group within your Azure subscription 46 | 47 | ``` bash 48 | az group create -n {name of resource group to create} 49 | ``` 50 | 51 | * Deploy the [Azure Resource Manager Template](./azuredeploy.json) 52 | 53 | ``` bash 54 | az group deployment create -g {name of resource group created} --template-file azuredeploy.json 55 | ``` 56 | 57 | * Authenticate the arm API Connector that was deployed with the template 58 | * Navigate to the "Edit API Connection" blade of the arm API Connection Resource 59 | * Click the "Authorize" 60 | * Login to the appropriate Azure Subscription 61 | 62 | ![Screen shot of Azure Resource Manager Edit API Connection screen](./resources/arm-edit-api.png) 63 | 64 | * Authenticate the azuredevops API connector that was deployed with the template 65 | * Navigate to the "Edit API Connection" blade of the azuredevops API Connection Resource 66 | * Click the "Authorize" 67 | * Login to the appropriate Azure DevOps subscription 68 | 69 | ![Screen shot of Azure DevOps Edit API Connection screen](./resources/devops-edit-api.png) 70 | 71 | ## Running the sample 72 | 73 | To run do the following 74 | 75 | * Acquire the URL from the deployed logic app. 76 | * Open the logic app's designer view blade 77 | * Click on the "When a HTTP request is received" action 78 | * Copy the url 79 | 80 | ![Screen shot of Logic App Designer View](./resources/get-url-from-app.png) 81 | 82 | * Construct the payload for the post request using the [Pipeline Orchestration Payload Documentation](./PIPELINE_PAYLOAD.md). 83 | * Use your url posting tool of choice (Postman, curl, etc...). To post the request to the Logic app 84 | 85 | ## Key concepts 86 | 87 | This sample allows for orchestration of many Azure DevOps pipelines using an Azure Logic App. This is very useful for scenarios where a series of discrete Azure DevOps pipelines are used to create/maintain/update small services within a larger ecosystem of services. In this environment you would want to have CI/CD pipelines created to allow for each discrete service to by deployed individually. However, when a new environment is required, be it for testing, development, scaling, disaster recovery, etc., creating that new environment requires the execution of those pipelines in specific sequences and differing parameters. 88 | 89 | This sample allows for those scenarios by: 90 | 91 | * queueing builds of the pipelines 92 | * with provided parameters 93 | * in the sequence defined 94 | 95 | It also allows for pipelines to be queued asychroniously, after the primary pipelines have completed. 96 | 97 | Refer to the [pipeline payload documentation](./PIPELINE_PAYLOD.md) to see how to provide that information. 98 | 99 | You can review the detailed workflow of the Logic App after you deploy it to your Azure Subscription, but at a high level the Logic App uses the following work flow: 100 | 101 | ![High Level workflow of logic app](./resources/workflow.png) 102 | 103 | 106 | 107 | ## Contributing 108 | 109 | This project welcomes contributions and suggestions. Most contributions require you to agree to a 110 | Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us 111 | the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. 112 | 113 | When you submit a pull request, a CLA bot will automatically determine whether you need to provide 114 | a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions 115 | provided by the bot. You will only need to do this once across all repos using our CLA. 116 | 117 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). 118 | For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or 119 | contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. 120 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ## Security 4 | 5 | Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/). 6 | 7 | If you believe you have found a security vulnerability in any Microsoft-owned repository that meets Microsoft's [Microsoft's definition of a security vulnerability](https://docs.microsoft.com/en-us/previous-versions/tn-archive/cc751383(v=technet.10)) of a security vulnerability, please report it to us as described below. 8 | 9 | ## Reporting Security Issues 10 | 11 | **Please do not report security vulnerabilities through public GitHub issues.** 12 | 13 | Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://msrc.microsoft.com/create-report). 14 | 15 | If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the the [Microsoft Security Response Center PGP Key page](https://www.microsoft.com/en-us/msrc/pgp-key-msrc). 16 | 17 | You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc). 18 | 19 | Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue: 20 | 21 | * Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.) 22 | * Full paths of source file(s) related to the manifestation of the issue 23 | * The location of the affected source code (tag/branch/commit or direct URL) 24 | * Any special configuration required to reproduce the issue 25 | * Step-by-step instructions to reproduce the issue 26 | * Proof-of-concept or exploit code (if possible) 27 | * Impact of the issue, including how an attacker might exploit the issue 28 | 29 | This information will help us triage your report more quickly. 30 | 31 | If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://microsoft.com/msrc/bounty) page for more details about our active programs. 32 | 33 | ## Preferred Languages 34 | 35 | We prefer all communications to be in English. 36 | 37 | ## Policy 38 | 39 | Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://www.microsoft.com/en-us/msrc/cvd). 40 | 41 | 42 | -------------------------------------------------------------------------------- /azuredeploy.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "logicAppName": { 6 | "type": "string", 7 | "defaultValue": "[concat(uniqueString(concat(subscription().subscriptionId, resourceGroup().name)), '-pipeline-orchestrator')]", 8 | "metadata": { 9 | "description": "The name of the logic app." 10 | } 11 | }, 12 | "location": { 13 | "type": "String", 14 | "defaultValue": "[resourceGroup().location]", 15 | "metadata": { 16 | "description": "The location resources will be deployed to" 17 | } 18 | } 19 | }, 20 | "variables": { 21 | "baseConnectionsId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Web/locations/', parameters('location'), '/managedApis/')]", 22 | "armConnectionName": "arm", 23 | "armManagedApiId": "[concat(variables('baseConnectionsId'), variables('armConnectionName'))]", 24 | "azdoConnectionName": "azuredevops", 25 | "azdoManagedApiId": "[concat(variables('baseConnectionsId'), 'visualstudioteamservices')]" 26 | }, 27 | "resources": [ 28 | { 29 | "type": "Microsoft.Web/connections", 30 | "apiVersion": "2016-06-01", 31 | "name": "[variables('armConnectionName')]", 32 | "location": "[parameters('location')]", 33 | "properties": { 34 | "displayName": "[variables('armConnectionName')]", 35 | "customParameterValues": { 36 | }, 37 | "api": { 38 | "id": "[variables('armManagedApiId')]" 39 | } 40 | } 41 | }, 42 | { 43 | "type": "Microsoft.Web/connections", 44 | "apiVersion": "2016-06-01", 45 | "name": "[variables('azdoConnectionName')]", 46 | "location": "[parameters('location')]", 47 | "properties": { 48 | "displayName": "[variables('azdoConnectionName')]", 49 | "customParameterValues": { 50 | }, 51 | "api": { 52 | "id": "[variables('azdoManagedApiId')]" 53 | } 54 | } 55 | }, 56 | { 57 | "name": "[parameters('logicAppName')]", 58 | "type": "Microsoft.Logic/workflows", 59 | "location": "[parameters('location')]", 60 | "apiVersion": "2016-06-01", 61 | "dependsOn": [ 62 | "[resourceId('Microsoft.Web/connections', variables('armConnectionName'))]" 63 | ], 64 | "properties": { 65 | "definition": { 66 | "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#", 67 | "actions": { 68 | "For_each_Primary_Sync_Pipeline": { 69 | "actions": { 70 | "ifFailureHasntOccurred": { 71 | "actions": { 72 | "Find_primary_definition": { 73 | "inputs": { 74 | "from": "@body('Find_primary_definition_name')", 75 | "where": "@equals(item()?['path'], body('primarySyncInfo')?['path'])" 76 | }, 77 | "runAfter": { 78 | "Find_primary_definition_name": [ 79 | "Succeeded" 80 | ] 81 | }, 82 | "type": "Query" 83 | }, 84 | "Find_primary_definition_name": { 85 | "inputs": { 86 | "from": "@body('GetAllDefinitions')?['value']", 87 | "where": "@equals(item()?['name'], body('primarySyncInfo')?['name'])" 88 | }, 89 | "runAfter": { 90 | "Set_parameters": [ 91 | "Succeeded" 92 | ] 93 | }, 94 | "type": "Query" 95 | }, 96 | "For_each_parameter": { 97 | "actions": { 98 | "Append_to_dynamic_parameters": { 99 | "inputs": { 100 | "name": "dynamicParameters", 101 | "value": ",\"@{body('Parse_Parameter')?['name']}\": \"@{body('Parse_Parameter')?['value']}\"" 102 | }, 103 | "runAfter": { 104 | "Parse_Parameter": [ 105 | "Succeeded" 106 | ] 107 | }, 108 | "type": "AppendToStringVariable" 109 | }, 110 | "Parse_Parameter": { 111 | "inputs": { 112 | "content": "@items('For_each_parameter')", 113 | "schema": { 114 | "properties": { 115 | "name": { 116 | "type": "string" 117 | }, 118 | "value": { 119 | "type": "string" 120 | } 121 | }, 122 | "type": "object" 123 | } 124 | }, 125 | "runAfter": { 126 | }, 127 | "type": "ParseJson" 128 | } 129 | }, 130 | "foreach": "@body('primarySyncInfo')?['parameters']", 131 | "runAfter": { 132 | "Reset_dynamic_parameters": [ 133 | "Succeeded" 134 | ] 135 | }, 136 | "type": "Foreach" 137 | }, 138 | "Reset_dynamic_parameters": { 139 | "inputs": { 140 | "name": "dynamicParameters", 141 | "value": "@variables('empty')" 142 | }, 143 | "runAfter": { 144 | "primarySyncInfo": [ 145 | "Succeeded" 146 | ] 147 | }, 148 | "type": "SetVariable" 149 | }, 150 | "Set_parameters": { 151 | "inputs": { 152 | "name": "parameters", 153 | "value": "{\n \"workGroupId\": \"@{triggerBody()?['workGroupId']}\",\n \"environment\": \"@{triggerBody()?['environment']}\",\n \"location\": \"@{triggerBody()?['location']}\"@{variables('dynamicParameters')}\n}" 154 | }, 155 | "runAfter": { 156 | "For_each_parameter": [ 157 | "Succeeded" 158 | ] 159 | }, 160 | "type": "SetVariable" 161 | }, 162 | "Switch": { 163 | "cases": { 164 | "Case_Pipeline": { 165 | "actions": { 166 | "Reset_test_condition": { 167 | "inputs": { 168 | "name": "pipelineStatus", 169 | "value": "@variables('empty')" 170 | }, 171 | "runAfter": { 172 | }, 173 | "type": "SetVariable" 174 | }, 175 | "Set_Failed": { 176 | "inputs": { 177 | "name": "hasFailed", 178 | "value": true 179 | }, 180 | "runAfter": { 181 | "Until_pipeline_status_is_complete_or_failed": [ 182 | "Failed", 183 | "TimedOut" 184 | ] 185 | }, 186 | "type": "SetVariable" 187 | }, 188 | "Until_pipeline_status_is_complete_or_failed": { 189 | "actions": { 190 | "Get_Build_Status": { 191 | "inputs": { 192 | "body": { 193 | "Method": "GET", 194 | "Uri": "/@{triggerBody()?['project']}/_apis/build/builds/@{body('queuePipeline')?['id']}?api-version=5.1" 195 | }, 196 | "host": { 197 | "connection": { 198 | "name": "@parameters('$connections')['azuredevops']['connectionId']" 199 | } 200 | }, 201 | "method": "post", 202 | "path": "/httprequest", 203 | "queries": { 204 | "account": "@triggerBody()?['organization']" 205 | } 206 | }, 207 | "runAfter": { 208 | "Slow_it_down": [ 209 | "Succeeded" 210 | ] 211 | }, 212 | "type": "ApiConnection" 213 | }, 214 | "Parse_Pipeline_Status": { 215 | "inputs": { 216 | "content": "@body('Get_Build_Status')", 217 | "schema": { 218 | "properties": { 219 | "result": { 220 | "type": "string" 221 | }, 222 | "status": { 223 | "type": "string" 224 | } 225 | }, 226 | "type": "object" 227 | } 228 | }, 229 | "runAfter": { 230 | "Get_Build_Status": [ 231 | "Succeeded" 232 | ] 233 | }, 234 | "type": "ParseJson" 235 | }, 236 | "Set_pipeline_status_to_completed": { 237 | "inputs": { 238 | "name": "pipelineStatus", 239 | "value": "@body('Parse_Pipeline_Status')?['status']" 240 | }, 241 | "runAfter": { 242 | "Parse_Pipeline_Status": [ 243 | "Succeeded" 244 | ] 245 | }, 246 | "type": "SetVariable" 247 | }, 248 | "Slow_it_down": { 249 | "inputs": { 250 | "interval": { 251 | "count": 1, 252 | "unit": "Minute" 253 | } 254 | }, 255 | "runAfter": { 256 | }, 257 | "type": "Wait" 258 | }, 259 | "is_failed": { 260 | "actions": { 261 | "report_failure": { 262 | "inputs": { 263 | "name": "hasFailed", 264 | "value": true 265 | }, 266 | "runAfter": { 267 | }, 268 | "type": "SetVariable" 269 | } 270 | }, 271 | "expression": { 272 | "and": [ 273 | { 274 | "equals": [ 275 | "@body('Parse_Pipeline_Status')?['status']", 276 | "completed" 277 | ] 278 | }, 279 | { 280 | "not": { 281 | "equals": [ 282 | "@body('Parse_Pipeline_Status')?['result']", 283 | "succeeded" 284 | ] 285 | } 286 | } 287 | ] 288 | }, 289 | "runAfter": { 290 | "Set_pipeline_status_to_completed": [ 291 | "Succeeded" 292 | ] 293 | }, 294 | "type": "If" 295 | } 296 | }, 297 | "expression": "@equals(variables('pipelineStatus'), 'completed')", 298 | "limit": { 299 | "count": 60, 300 | "timeout": "PT1H" 301 | }, 302 | "runAfter": { 303 | "Reset_test_condition": [ 304 | "Succeeded" 305 | ] 306 | }, 307 | "type": "Until" 308 | } 309 | }, 310 | "case": "pipeline" 311 | }, 312 | "Case_Resource_Group": { 313 | "actions": { 314 | "FlagFailure": { 315 | "inputs": { 316 | "name": "hasFailed", 317 | "value": true 318 | }, 319 | "runAfter": { 320 | "SyncExecutionScope": [ 321 | "Failed", 322 | "TimedOut" 323 | ] 324 | }, 325 | "type": "SetVariable" 326 | }, 327 | "Set_resource_group_name": { 328 | "actions": { 329 | "Set_dynamic_resource_group_name": { 330 | "inputs": { 331 | "name": "resourceGroupName", 332 | "value": "@{triggerBody()?['workGroupId']}-@{triggerBody()?['location']}-@{triggerBody()?['environment']}-@{body('primarySyncInfo')?['resourceGroupName']}" 333 | }, 334 | "runAfter": { 335 | }, 336 | "type": "SetVariable" 337 | } 338 | }, 339 | "else": { 340 | "actions": { 341 | "Set_passed_resource_group_name": { 342 | "inputs": { 343 | "name": "resourceGroupName", 344 | "value": "@{items('For_each_Primary_Sync_Pipeline')['resourceGroupName']}" 345 | }, 346 | "runAfter": { 347 | }, 348 | "type": "SetVariable" 349 | } 350 | } 351 | }, 352 | "expression": { 353 | "and": [ 354 | { 355 | "equals": [ 356 | "@items('For_each_Primary_Sync_Pipeline')['useResourceGroupNamingConvention']", 357 | true 358 | ] 359 | } 360 | ] 361 | }, 362 | "runAfter": { 363 | }, 364 | "type": "If" 365 | }, 366 | "SyncExecutionScope": { 367 | "actions": { 368 | "Delay": { 369 | "inputs": { 370 | "interval": { 371 | "count": 2, 372 | "unit": "Minute" 373 | } 374 | }, 375 | "runAfter": { 376 | }, 377 | "type": "Wait" 378 | }, 379 | "Read_a_template_deployment": { 380 | "inputs": { 381 | "host": { 382 | "connection": { 383 | "name": "@parameters('$connections')['arm']['connectionId']" 384 | } 385 | }, 386 | "method": "get", 387 | "path": "/subscriptions/@{encodeURIComponent(triggerBody()?['azureSubscriptionId'])}/resourcegroups/@{encodeURIComponent(variables('resourceGroupName'))}/providers/Microsoft.Resources/deployments/@{encodeURIComponent(body('queuePipeline')?['buildNumber'])}", 388 | "queries": { 389 | "wait": true, 390 | "x-ms-api-version": "2016-06-01" 391 | } 392 | }, 393 | "runAfter": { 394 | "Delay": [ 395 | "Succeeded" 396 | ] 397 | }, 398 | "type": "ApiConnection" 399 | } 400 | }, 401 | "runAfter": { 402 | "Wait_for_Pipeline_to_start": [ 403 | "Succeeded" 404 | ] 405 | }, 406 | "type": "Scope" 407 | }, 408 | "Wait_for_Pipeline_to_start": { 409 | "actions": { 410 | "Set_test_condition": { 411 | "inputs": { 412 | "name": "pipelineStatus", 413 | "value": "@variables('empty')" 414 | }, 415 | "runAfter": { 416 | }, 417 | "type": "SetVariable" 418 | }, 419 | "Until": { 420 | "actions": { 421 | "Delay_the_check": { 422 | "inputs": { 423 | "interval": { 424 | "count": 1, 425 | "unit": "Minute" 426 | } 427 | }, 428 | "runAfter": { 429 | }, 430 | "type": "Wait" 431 | }, 432 | "Get_pipeline_status": { 433 | "inputs": { 434 | "body": { 435 | "Method": "GET", 436 | "Uri": "/@{triggerBody()?['project']}/_apis/build/builds/@{body('queuePipeline')?['id']}?api-version=5.1" 437 | }, 438 | "host": { 439 | "connection": { 440 | "name": "@parameters('$connections')['azuredevops']['connectionId']" 441 | } 442 | }, 443 | "method": "post", 444 | "path": "/httprequest", 445 | "queries": { 446 | "account": "@triggerBody()?['organization']" 447 | } 448 | }, 449 | "runAfter": { 450 | "Delay_the_check": [ 451 | "Succeeded" 452 | ] 453 | }, 454 | "type": "ApiConnection" 455 | }, 456 | "If_not_waiting": { 457 | "actions": { 458 | "Set_variable": { 459 | "inputs": { 460 | "name": "pipelineStatus", 461 | "value": "inProgress" 462 | }, 463 | "runAfter": { 464 | }, 465 | "type": "SetVariable" 466 | } 467 | }, 468 | "expression": { 469 | "and": [ 470 | { 471 | "not": { 472 | "equals": [ 473 | "@body('Parse_status')?['status']", 474 | "notStarted" 475 | ] 476 | } 477 | }, 478 | { 479 | "not": { 480 | "equals": [ 481 | "@body('Parse_status')?['status']", 482 | "none" 483 | ] 484 | } 485 | } 486 | ] 487 | }, 488 | "runAfter": { 489 | "Parse_status": [ 490 | "Succeeded" 491 | ] 492 | }, 493 | "type": "If" 494 | }, 495 | "Parse_status": { 496 | "inputs": { 497 | "content": "@body('Get_pipeline_status')", 498 | "schema": { 499 | "properties": { 500 | "result": { 501 | "type": "string" 502 | }, 503 | "status": { 504 | "type": "string" 505 | } 506 | }, 507 | "type": "object" 508 | } 509 | }, 510 | "runAfter": { 511 | "Get_pipeline_status": [ 512 | "Succeeded" 513 | ] 514 | }, 515 | "type": "ParseJson" 516 | } 517 | }, 518 | "expression": "@equals(variables('pipelineStatus'), 'inProgress')", 519 | "limit": { 520 | "count": 60, 521 | "timeout": "PT1H" 522 | }, 523 | "runAfter": { 524 | "Set_test_condition": [ 525 | "Succeeded" 526 | ] 527 | }, 528 | "type": "Until" 529 | } 530 | }, 531 | "runAfter": { 532 | "Set_resource_group_name": [ 533 | "Succeeded" 534 | ] 535 | }, 536 | "type": "Scope" 537 | } 538 | }, 539 | "case": "resourceGroup" 540 | } 541 | }, 542 | "default": { 543 | "actions": { 544 | } 545 | }, 546 | "expression": "@body('primarySyncInfo')?['validationType']", 547 | "runAfter": { 548 | "queuePipeline": [ 549 | "Succeeded" 550 | ] 551 | }, 552 | "type": "Switch" 553 | }, 554 | "primarySyncInfo": { 555 | "inputs": { 556 | "content": "@items('For_each_Primary_Sync_Pipeline')", 557 | "schema": { 558 | "properties": { 559 | "branch": { 560 | "type": "string" 561 | }, 562 | "name": { 563 | "type": "string" 564 | }, 565 | "parameters": { 566 | "items": { 567 | "properties": { 568 | "name": { 569 | "type": "string" 570 | }, 571 | "value": { 572 | "type": "string" 573 | } 574 | }, 575 | "required": [ 576 | "name", 577 | "value" 578 | ], 579 | "type": "object" 580 | }, 581 | "type": "array" 582 | }, 583 | "path": { 584 | "type": "string" 585 | }, 586 | "resourceGroupName": { 587 | "type": "string" 588 | }, 589 | "useResourceGroupNamingConvention": { 590 | "type": "boolean" 591 | }, 592 | "validationType": { 593 | "type": "string" 594 | } 595 | }, 596 | "type": "object" 597 | } 598 | }, 599 | "runAfter": { 600 | }, 601 | "type": "ParseJson" 602 | }, 603 | "queuePipeline": { 604 | "inputs": { 605 | "body": { 606 | "parameters": "@variables('parameters')", 607 | "sourceBranch": "@body('primarySyncInfo')?['branch']" 608 | }, 609 | "host": { 610 | "connection": { 611 | "name": "@parameters('$connections')['azuredevops']['connectionId']" 612 | } 613 | }, 614 | "method": "post", 615 | "path": "/@{encodeURIComponent(triggerBody()?['project'])}/_apis/build/builds", 616 | "queries": { 617 | "account": "@triggerBody()?['organization']", 618 | "buildDefId": "@{first(body('Find_primary_definition'))['id']}" 619 | } 620 | }, 621 | "runAfter": { 622 | "Find_primary_definition": [ 623 | "Succeeded" 624 | ] 625 | }, 626 | "type": "ApiConnection" 627 | } 628 | }, 629 | "expression": { 630 | "and": [ 631 | { 632 | "equals": [ 633 | "@variables('hasFailed')", 634 | false 635 | ] 636 | } 637 | ] 638 | }, 639 | "runAfter": { 640 | }, 641 | "type": "If" 642 | } 643 | }, 644 | "foreach": "@triggerBody()?['primarySyncPipelines']", 645 | "runAfter": { 646 | "initDynamicParameters": [ 647 | "Succeeded" 648 | ], 649 | "initHasFailed": [ 650 | "Succeeded" 651 | ], 652 | "initPipelineStatus": [ 653 | "Succeeded" 654 | ], 655 | "initResourceGroupName": [ 656 | "Succeeded" 657 | ] 658 | }, 659 | "runtimeConfiguration": { 660 | "concurrency": { 661 | "repetitions": 1 662 | } 663 | }, 664 | "type": "Foreach" 665 | }, 666 | "GetAllDefinitions": { 667 | "inputs": { 668 | "body": { 669 | "Method": "GET", 670 | "Uri": "/@{triggerBody()?['project']}/_apis/build/definitions" 671 | }, 672 | "host": { 673 | "connection": { 674 | "name": "@parameters('$connections')['azuredevops']['connectionId']" 675 | } 676 | }, 677 | "method": "post", 678 | "path": "/httprequest", 679 | "queries": { 680 | "account": "@triggerBody()?['organization']" 681 | } 682 | }, 683 | "runAfter": { 684 | }, 685 | "type": "ApiConnection" 686 | }, 687 | "ifPrimaryHasntFailed": { 688 | "actions": { 689 | "For_each_secondary_async_pipeline": { 690 | "actions": { 691 | "Find_secondary_definition": { 692 | "inputs": { 693 | "from": "@body('Find_secondary_definition_name')", 694 | "where": "@equals(item()?['path'], body('secondaryAsyncInfo')?['path'])" 695 | }, 696 | "runAfter": { 697 | "Find_secondary_definition_name": [ 698 | "Succeeded" 699 | ] 700 | }, 701 | "type": "Query" 702 | }, 703 | "Find_secondary_definition_name": { 704 | "inputs": { 705 | "from": "@body('GetAllDefinitions')?['value']", 706 | "where": "@equals(item()?['name'], body('secondaryAsyncInfo')?['name'])" 707 | }, 708 | "runAfter": { 709 | "Set_secondary_parameters": [ 710 | "Succeeded" 711 | ] 712 | }, 713 | "type": "Query" 714 | }, 715 | "For_each": { 716 | "actions": { 717 | "Append_to_string_variable": { 718 | "inputs": { 719 | "name": "dynamicParameters", 720 | "value": ",\"@{body('Parse_secondary_parameters')?['name']}\": \"@{body('Parse_secondary_parameters')?['value']}\"" 721 | }, 722 | "runAfter": { 723 | "Parse_secondary_parameters": [ 724 | "Succeeded" 725 | ] 726 | }, 727 | "type": "AppendToStringVariable" 728 | }, 729 | "Parse_secondary_parameters": { 730 | "inputs": { 731 | "content": "@items('For_each')", 732 | "schema": { 733 | "properties": { 734 | "name": { 735 | "type": "string" 736 | }, 737 | "value": { 738 | "type": "string" 739 | } 740 | }, 741 | "type": "object" 742 | } 743 | }, 744 | "runAfter": { 745 | }, 746 | "type": "ParseJson" 747 | } 748 | }, 749 | "foreach": "@body('secondaryAsyncInfo')?['parameters']", 750 | "runAfter": { 751 | "Reset_secondary_dynamic_parameters": [ 752 | "Succeeded" 753 | ] 754 | }, 755 | "type": "Foreach" 756 | }, 757 | "Reset_secondary_dynamic_parameters": { 758 | "inputs": { 759 | "name": "dynamicParameters", 760 | "value": "@variables('empty')" 761 | }, 762 | "runAfter": { 763 | "secondaryAsyncInfo": [ 764 | "Succeeded" 765 | ] 766 | }, 767 | "type": "SetVariable" 768 | }, 769 | "Set_secondary_parameters": { 770 | "inputs": { 771 | "name": "parameters", 772 | "value": "{\n \"workGroupId\": \"@{triggerBody()?['workGroupId']}\",\n \"environment\": \"@{triggerBody()?['environment']}\",\n \"location\": \"@{triggerBody()?['location']}\"@{variables('dynamicParameters')}\n}" 773 | }, 774 | "runAfter": { 775 | "For_each": [ 776 | "Succeeded" 777 | ] 778 | }, 779 | "type": "SetVariable" 780 | }, 781 | "queueChildPipeline": { 782 | "inputs": { 783 | "body": { 784 | "parameters": "@variables('parameters')", 785 | "sourceBranch": "@body('secondaryAsyncInfo')?['branch']" 786 | }, 787 | "host": { 788 | "connection": { 789 | "name": "@parameters('$connections')['azuredevops']['connectionId']" 790 | } 791 | }, 792 | "method": "post", 793 | "path": "/@{encodeURIComponent(triggerBody()?['project'])}/_apis/build/builds", 794 | "queries": { 795 | "account": "@triggerBody()?['organization']", 796 | "buildDefId": "@{first(body('Find_secondary_definition'))['id']}" 797 | } 798 | }, 799 | "runAfter": { 800 | "Find_secondary_definition": [ 801 | "Succeeded" 802 | ] 803 | }, 804 | "type": "ApiConnection" 805 | }, 806 | "secondaryAsyncInfo": { 807 | "inputs": { 808 | "content": "@items('For_each_secondary_async_pipeline')", 809 | "schema": { 810 | "properties": { 811 | "branch": { 812 | "type": "string" 813 | }, 814 | "name": { 815 | "type": "string" 816 | }, 817 | "parameters": { 818 | "type": "array" 819 | } 820 | }, 821 | "type": "object" 822 | } 823 | }, 824 | "runAfter": { 825 | }, 826 | "type": "ParseJson" 827 | } 828 | }, 829 | "foreach": "@triggerBody()?['secondaryAsyncPipelines']", 830 | "runAfter": { 831 | }, 832 | "type": "Foreach" 833 | } 834 | }, 835 | "expression": { 836 | "and": [ 837 | { 838 | "equals": [ 839 | "@variables('hasFailed')", 840 | false 841 | ] 842 | } 843 | ] 844 | }, 845 | "runAfter": { 846 | "For_each_Primary_Sync_Pipeline": [ 847 | "Succeeded" 848 | ] 849 | }, 850 | "type": "If" 851 | }, 852 | "initDynamicParameters": { 853 | "inputs": { 854 | "variables": [ 855 | { 856 | "name": "dynamicParameters", 857 | "type": "string" 858 | } 859 | ] 860 | }, 861 | "runAfter": { 862 | "initParameters": [ 863 | "Succeeded" 864 | ] 865 | }, 866 | "type": "InitializeVariable" 867 | }, 868 | "initEmpty": { 869 | "inputs": { 870 | "variables": [ 871 | { 872 | "name": "empty", 873 | "type": "String" 874 | } 875 | ] 876 | }, 877 | "runAfter": { 878 | "GetAllDefinitions": [ 879 | "Succeeded" 880 | ] 881 | }, 882 | "type": "InitializeVariable" 883 | }, 884 | "initHasFailed": { 885 | "inputs": { 886 | "variables": [ 887 | { 888 | "name": "hasFailed", 889 | "type": "boolean", 890 | "value": false 891 | } 892 | ] 893 | }, 894 | "runAfter": { 895 | "GetAllDefinitions": [ 896 | "Succeeded" 897 | ] 898 | }, 899 | "type": "InitializeVariable" 900 | }, 901 | "initParameters": { 902 | "inputs": { 903 | "variables": [ 904 | { 905 | "name": "parameters", 906 | "type": "string" 907 | } 908 | ] 909 | }, 910 | "runAfter": { 911 | "GetAllDefinitions": [ 912 | "Succeeded" 913 | ] 914 | }, 915 | "type": "InitializeVariable" 916 | }, 917 | "initPipelineStatus": { 918 | "inputs": { 919 | "variables": [ 920 | { 921 | "name": "pipelineStatus", 922 | "type": "string" 923 | } 924 | ] 925 | }, 926 | "runAfter": { 927 | "initEmpty": [ 928 | "Succeeded" 929 | ] 930 | }, 931 | "type": "InitializeVariable" 932 | }, 933 | "initResourceGroupName": { 934 | "inputs": { 935 | "variables": [ 936 | { 937 | "name": "resourceGroupName", 938 | "type": "String" 939 | } 940 | ] 941 | }, 942 | "runAfter": { 943 | "GetAllDefinitions": [ 944 | "Succeeded" 945 | ] 946 | }, 947 | "type": "InitializeVariable" 948 | } 949 | }, 950 | "contentVersion": "1.0.0.0", 951 | "outputs": { 952 | }, 953 | "parameters": { 954 | "$connections": { 955 | "defaultValue": { 956 | }, 957 | "type": "Object" 958 | } 959 | }, 960 | "triggers": { 961 | "manual": { 962 | "inputs": { 963 | "method": "POST", 964 | "schema": { 965 | "properties": { 966 | "azureSubscriptionId": { 967 | "type": "string" 968 | }, 969 | "environment": { 970 | "type": "string" 971 | }, 972 | "location": { 973 | "type": "string" 974 | }, 975 | "organization": { 976 | "type": "string" 977 | }, 978 | "primarySyncPipelines": { 979 | "type": "array" 980 | }, 981 | "project": { 982 | "type": "string" 983 | }, 984 | "secondaryAsyncPipelines": { 985 | "type": "array" 986 | }, 987 | "workGroupId": { 988 | "type": "string" 989 | } 990 | }, 991 | "type": "object" 992 | } 993 | }, 994 | "kind": "Http", 995 | "type": "Request" 996 | } 997 | } 998 | }, 999 | "parameters": { 1000 | "$connections": { 1001 | "value": { 1002 | "arm": { 1003 | "connectionId": "[resourceId('Microsoft.Web/connections', variables('armConnectionName'))]", 1004 | "connectionName": "arm", 1005 | "id": "[variables('armManagedApiId')]" 1006 | }, 1007 | "azuredevops": { 1008 | "connectionId": "[resourceId('Microsoft.Web/connections', variables('azdoConnectionName'))]", 1009 | "connectionName": "azuredevops", 1010 | "id": "[variables('azdoManagedApiId')]" 1011 | } 1012 | } 1013 | } 1014 | } 1015 | }, 1016 | "resources": [ 1017 | ] 1018 | } 1019 | ], 1020 | "outputs": { 1021 | "logicAppName": { 1022 | "type": "string", 1023 | "value": "[parameters('logicAppName')]" 1024 | } 1025 | } 1026 | } -------------------------------------------------------------------------------- /resources/Diagrams.pptx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/azure-logic-apps-pipeline-orchestration/c0c10cc4f296a0f3dd62b8101421136fe031c147/resources/Diagrams.pptx -------------------------------------------------------------------------------- /resources/arm-edit-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/azure-logic-apps-pipeline-orchestration/c0c10cc4f296a0f3dd62b8101421136fe031c147/resources/arm-edit-api.png -------------------------------------------------------------------------------- /resources/devops-edit-api.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/azure-logic-apps-pipeline-orchestration/c0c10cc4f296a0f3dd62b8101421136fe031c147/resources/devops-edit-api.png -------------------------------------------------------------------------------- /resources/get-url-from-app.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/azure-logic-apps-pipeline-orchestration/c0c10cc4f296a0f3dd62b8101421136fe031c147/resources/get-url-from-app.png -------------------------------------------------------------------------------- /resources/video-thumbprint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/azure-logic-apps-pipeline-orchestration/c0c10cc4f296a0f3dd62b8101421136fe031c147/resources/video-thumbprint.png -------------------------------------------------------------------------------- /resources/workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/azure-logic-apps-pipeline-orchestration/c0c10cc4f296a0f3dd62b8101421136fe031c147/resources/workflow.png -------------------------------------------------------------------------------- /resources/workflow.vsdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Azure-Samples/azure-logic-apps-pipeline-orchestration/c0c10cc4f296a0f3dd62b8101421136fe031c147/resources/workflow.vsdx -------------------------------------------------------------------------------- /samples/instance-two.json: -------------------------------------------------------------------------------- 1 | { 2 | "organization": "shgaul", 3 | "project": "LogicAppsAndDevOps", 4 | "azureSubscriptionId": "14dcebd1-63b8-4cd1-9c38-18802d4616fa", 5 | "location": "westus", 6 | "workGroupId": "scg02", 7 | "environment": "dev", 8 | "primarySyncPipelines": [ 9 | { 10 | "path": "\\CD", 11 | "name": "IntegrationEnvironmentResources", 12 | "branch": "master", 13 | "validationType": "resourceGroup", 14 | "resourceGroupName": "ise", 15 | "useResourceGroupNamingConvention": true, 16 | "parameters": [ 17 | { 18 | "name": "instance", 19 | "value": "-2" 20 | } 21 | ] 22 | } 23 | ], 24 | "secondaryAsyncPipelines": [ 25 | { 26 | "path": "\\CD", 27 | "name": "IngestionResources", 28 | "branch": "master", 29 | "parameters": [ 30 | { 31 | "name": "instance", 32 | "value": "-2" 33 | } 34 | ] 35 | }, 36 | { 37 | "path": "\\CD", 38 | "name": "TargetOneResources", 39 | "branch": "master", 40 | "parameters": [ 41 | { 42 | "name": "instance", 43 | "value": "-2" 44 | } 45 | ] 46 | }, 47 | { 48 | "path": "\\CD", 49 | "name": "TargetTwoResources", 50 | "branch": "master", 51 | "parameters": [ 52 | { 53 | "name": "instance", 54 | "value": "-2" 55 | } 56 | ] 57 | } 58 | ] 59 | } -------------------------------------------------------------------------------- /samples/just-the-base.json: -------------------------------------------------------------------------------- 1 | { 2 | "organization": "shgaul", 3 | "project": "LogicAppsAndDevOps", 4 | "azureSubscriptionId": "14dcebd1-63b8-4cd1-9c38-18802d4616fa", 5 | "location": "westus", 6 | "workGroupId": "scg02", 7 | "environment": "dev", 8 | "primarySyncPipelines": [ 9 | { 10 | "path": "\\CD", 11 | "name": "NetworkResources", 12 | "branch": "master", 13 | "validationType": "pipeline", 14 | "parameters": [ 15 | { 16 | "name": "instance", 17 | "value": "-1" 18 | } 19 | ] 20 | }, 21 | { 22 | "path": "\\CD", 23 | "name": "NetworkResources", 24 | "branch": "master", 25 | "validationType": "pipeline", 26 | "parameters": [ 27 | { 28 | "name": "instance", 29 | "value": "-2" 30 | } 31 | ] 32 | }, 33 | { 34 | "path": "\\CD", 35 | "name": "SharedResources", 36 | "branch": "master", 37 | "validationType": "pipeline", 38 | "parameters": [] 39 | }, 40 | { 41 | "path": "\\CD", 42 | "name": "IntegrationServiceEnvironment", 43 | "branch": "master", 44 | "validationType": "resourceGroup", 45 | "resourceGroupName": "ise", 46 | "useResourceGroupNamingConvention": true, 47 | "parameters": [] 48 | } 49 | ], 50 | "secondaryAsyncPipelines": [] 51 | } -------------------------------------------------------------------------------- /samples/second-instance.json: -------------------------------------------------------------------------------- 1 | { 2 | "organization": "shgaul", 3 | "project": "LogicAppsAndDevOps", 4 | "azureSubscriptionId": "14dcebd1-63b8-4cd1-9c38-18802d4616fa", 5 | "location": "westus", 6 | "workGroupId": "scg03", 7 | "environment": "dev", 8 | "primarySyncPipelines": [ 9 | { 10 | "path": "\\CD", 11 | "name": "IntegrationEnvironmentResources", 12 | "branch": "master", 13 | "validationType": "resourceGroup", 14 | "resourceGroupName": "ise", 15 | "useResourceGroupNamingConvention": true, 16 | "parameters": [ 17 | { 18 | "name": "instance", 19 | "value": "-2" 20 | } 21 | ] 22 | } 23 | ], 24 | "secondaryAsyncPipelines": [ 25 | { 26 | "path": "\\CD", 27 | "name": "IngestionResources", 28 | "branch": "master", 29 | "parameters": [ 30 | { 31 | "name": "instance", 32 | "value": "-2" 33 | } 34 | ] 35 | }, 36 | { 37 | "path": "\\CD", 38 | "name": "TargetTwoResources", 39 | "branch": "master", 40 | "parameters": [ 41 | { 42 | "name": "instance", 43 | "value": "-2" 44 | } 45 | ] 46 | } 47 | ] 48 | } -------------------------------------------------------------------------------- /samples/the-whole-kit.json: -------------------------------------------------------------------------------- 1 | { 2 | "organization": "shgaul", 3 | "project": "LogicAppsAndDevOps", 4 | "azureSubscriptionId": "14dcebd1-63b8-4cd1-9c38-18802d4616fa", 5 | "location": "westus", 6 | "workGroupId": "scg03", 7 | "environment": "dev", 8 | "primarySyncPipelines": [ 9 | { 10 | "path": "\\CD", 11 | "name": "NetworkResources", 12 | "branch": "master", 13 | "validationType": "pipeline", 14 | "parameters": [ 15 | { 16 | "name": "instance", 17 | "value": "-1" 18 | } 19 | ] 20 | }, 21 | { 22 | "path": "\\CD", 23 | "name": "NetworkResources", 24 | "branch": "master", 25 | "validationType": "pipeline", 26 | "parameters": [ 27 | { 28 | "name": "instance", 29 | "value": "-2" 30 | } 31 | ] 32 | }, 33 | { 34 | "path": "\\CD", 35 | "name": "SharedResources", 36 | "branch": "master", 37 | "validationType": "pipeline", 38 | "parameters": [] 39 | }, 40 | { 41 | "path": "\\CD", 42 | "name": "IntegrationEnvironmentResources", 43 | "branch": "master", 44 | "validationType": "resourceGroup", 45 | "resourceGroupName": "ise", 46 | "useResourceGroupNamingConvention": true, 47 | "parameters": [ 48 | { 49 | "name": "instance", 50 | "value": "-1" 51 | } 52 | ] 53 | } 54 | ], 55 | "secondaryAsyncPipelines": [ 56 | { 57 | "path": "\\CD", 58 | "name": "IngestionResources", 59 | "branch": "master", 60 | "parameters": [ 61 | { 62 | "name": "instance", 63 | "value": "-1" 64 | } 65 | ] 66 | }, 67 | { 68 | "path": "\\CD", 69 | "name": "TargetOneResources", 70 | "branch": "master", 71 | "parameters": [ 72 | { 73 | "name": "instance", 74 | "value": "-1" 75 | } 76 | ] 77 | }, 78 | { 79 | "path": "\\CD", 80 | "name": "TargetTwoResources", 81 | "branch": "master", 82 | "parameters": [ 83 | { 84 | "name": "instance", 85 | "value": "-1" 86 | } 87 | ] 88 | } 89 | ] 90 | } --------------------------------------------------------------------------------