如何通过Azure Devops CI/CD用单臂模板部署多个逻辑应用程序? [英] How to deploy multiple logic app with single arm template via Azure Devops CI/CD?
问题描述
我有多个逻辑应用程序,带有相应的ARM模板.现在,我想将不同的ARM模板合并到一个ARM模板中,并通过AZURE-DEVOPS管道同时部署多个逻辑应用程序.
I have multiple logic app with corresponding ARM template. Now, I want to merge different ARM templates into one ARM template and deploy the multiple logic app at the same time via AZURE-DEVOPS pipeline.
推荐答案
对于您的方案,首先需要更改ARM模板结构.
For your scenario, you need firstly make change to your ARM template structure.
例如,我想将4个ARM模板合并为一个ARM模板.这样我就可以使用一个 ARM模板deploy
任务来部署4个服务.
For example, I want to combine 4 ARM templates into one ARM template. So that I can just use one ARM template deploy
task to deploy 4 services.
现在,我需要创建一个具有以下结构的组合ARM模板文件:
Now, I need create a combined ARM templates file with below structure:
Repo ArmDeploy
| Nested Templates
| | NestOne
| | | NestOne.json
| | | NestOne.parameters.json
| | NestTwo
| | | NestTwo.json
| | | NestTwo.parameters.json
| | NestThree
| | | NestThree.json
| | | NestThree.parameters.json
| | NestFour
| | | NestFour.json
| | | NestFour.parameters.json
| azuredeploy.json
| azuredeploy.parameters.json
对于 azuredeploy.yml
和 azuredeploy.parameters.yml
的内容,您可以从此一个.
For the contents of azuredeploy.yml
and azuredeploy.parameters.yml
, you can check the sample and the description from this doc, along with this one.
现在,仅可以使用一个 ARM deploy
任务来部署多个服务.只需指定azuredeploy.json并指定task参数:
Now, it is available to use only one ARM deploy
task to deploy several services. Just specify azuredeploy.json and to the task parameter:
- task: AzureResourceGroupDeployment@2
displayName: 'Several services deploy'
inputs:
azureSubscription: 'xxxxx'
resourceGroupName: 'xxxx'
location: 'xxxxxx'
csmFile: azuredeploy.json
csmParametersFile: azuredeploy.parameters.json
这篇关于如何通过Azure Devops CI/CD用单臂模板部署多个逻辑应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!