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.
Asked
Active
Viewed 1,430 times
2

Parminder Singh
- 77
- 2
- 10
-
1Ideally I would caution you against it, keep them separated and follow single responsibility principle – Mandar Dharmadhikari Apr 08 '20 at 11:25
-
May I know what's the status of this? Does below suggestion is help to you? Free to comment if you still has any puzzle to it:-) – Mengdi Liang Apr 18 '20 at 04:49
-
@MerlinLiang-MSFT Thanks for your help. I am still trying to implement your suggestion, by using "template link " property. It would be great , if you can please give me some examples of working ARM templates by using nested template approach – Parminder Singh Apr 22 '20 at 09:08
-
I have just been through something similar. I have collection of related Logic Apps and connectors in a Resource Group and export Template before editing it into single template file and parameter.test.json / parameter.prod.json template files. These are added to GitHub. In DevOps I have created a Release Pipeline whose Artifect is the GitHub repo, each stage item then has a job ARM deploy, where I reference the artifact and set the main template file and relevant parameter file in the relevant placeholders. – drewglew May 01 '20 at 17:57
-
@drewglew Can you please give an example of how to call child template from storage account ? I have uploaded one arm-template into storage account and I want to link it into master arm template ? – Parminder Singh May 05 '20 at 09:00
-
I am unsure when using a storage account as authentication is not trivial - https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-tutorial-linked-template?tabs=azure-powershell was a great intro for me in setting up inside GitHub.. I did have a problem referencing private GitHub repository, but managed to get this working in the end. – drewglew May 06 '20 at 15:39
1 Answers
2
For your scenario, you need firstly make change to your ARM template structure.
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.
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
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.
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

Mengdi Liang
- 17,577
- 2
- 28
- 35