如何将现有模板分为链接的模板 [英] How can I divide an existing template into linked Templates

查看:125
本文介绍了如何将现有模板分为链接的模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

自动生成的手臂模板并不是要准备好投入生产,它们需要完善.这是预期的.

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

Devops员工如何将自动生成的ARM模板划分为链接模板?

参考

链接的模板

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

Azure ARM模板部署

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

推荐答案

Devops员工如何将自动生成的ARM模板划分为链接模板?

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.

创建部署项目后,可以右键单击部署项目,然后单击添加>新建项目",选择"Azure Resource Manager部署模板",然后将现有的ARM模板复制/粘贴到您的azuredeploy.json中,然后您可以通过单击查看>其他Windows> JSON大纲"来启用 JSON大纲窗口,然后可以选择将资源划分为Linked模板,然后复制相关的资源配置(资源定义,变量,参数等)添加到新的"Azure资源管理器部署模板"中.在这里,我将HostingPlan划分为一个链接模板,在部署我的Azure网站时,我将按以下方式使用托管计划链接模板:

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:

使用主机计划链接模板部署Azure网站

Azure网站部署模板: https://brucechen.blob. core.windows.net/arm-templates/websitewithlinkedtemplate.json

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:

这篇关于如何将现有模板分为链接的模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆