How can I divide an existing template into linked Templates

一个人想着一个人 提交于 2019-12-11 07:32:20

问题


Auto generated arm templates aren't meant to be production ready, they need refinement. that is expected.

How can a Devops staff divide auto generated ARM templates into Linked templates?

References

Linked Templates

https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-linked-templates

Azure ARM template deployment

https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-overview#template-deployment


回答1:


How can a Devops staff divide auto generated ARM templates into Linked templates?

Per my understanding, you could leverage Azure Resource Group deployment project through visual studio for a simple to divide your ARM template into Linked templates manually.

After you created the deployment project, you could right click your deployment project and click "Add > New Item", choose "Azure Resource Manager Deployment Template", then copy/paste your existed ARM template into your azuredeploy.json, then you could enable JSON Outline window by clicking "View > Other Windows > JSON Outline", then you could choose the resources which would be divided into Linked template, then copy the related resource configurations (resource definition, variables, parameters,etc.) into a new "Azure Resource Manager Deployment Template". Here I divided the HostingPlan into a Linked template, when deploying my azure website, I would use the hosting plan linked template as follows:

Deploying azure website with a host plan linked template

Azure website deployment template: https://brucechen.blob.core.windows.net/arm-templates/websitewithlinkedtemplate.json

Then, check the latest deployment log under "SETTING > Deployments" section of your resource group as follows:



来源:https://stackoverflow.com/questions/44884446/how-can-i-divide-an-existing-template-into-linked-templates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!