Azure Resource Manager ::嵌套模板

时间:2015-08-30 18:31:34

标签: azure azure-resource-manager

Microsoft Azure资源管理器(ARM)API支持嵌套的JSON模板,用于声明性配置云资源。但是,文档[目前]没有说明支持多少层嵌套。它只是一层嵌套,还是可以进一步嵌套?如果是这样,深度限制是多少?

https://azure.microsoft.com/en-us/documentation/articles/resource-group-linked-templates/

1 个答案:

答案 0 :(得分:6)

是的,没有明确的限制。如果检查json模式,则不会找到任何定义的最大限制:deployment template schema。但是,Azure部署模板的总大小有限,且不得超过1MB:

  

您必须将模板的大小限制为1 MB,并将每个参数文件限制为64 KB。 1 MB限制适用于模板使用迭代资源定义以及变量和参数值扩展后的最终状态。

不要与public class PressureInput { private int sysInput; private int diaInput; private int sysAvrg; private int diaAvrg; public PressureInput() { sysInput = 0; diaInput = 0; sysAvrg = 0; diaAvrg = 0; } public void setSysPressure() { sysInput = 0; while(sysInput <= 0 || sysInput >= 320) { Scanner cin = new Scanner(System.in); System.out.println("Please enter a systolic reading> "); sysInput= cin.nextInt(); System.out.println("You have entered " + sysInput + "\n"); if(sysInput <=0 || sysInput >= 320) { System.out.println("You're either dead or entered" + " an error. Try again." + "\n"); } } sysAvrg += sysInput; } public int getSysPressure() { return sysInput; } public void setDiaPressure() { diaInput = 0; while(diaInput <= 0 || diaInput >= 320) { Scanner cin = new Scanner(System.in); System.out.println("Please enter a systolic reading> "); diaInput= cin.nextInt(); System.out.println("You have entered " + diaInput + "\n"); if(diaInput <=0 || diaInput >= 320) { System.out.println("You're either dead or entered" + " an error. Try again." + "\n"); } } diaAvrg += diaAvrg; } public int getDiaPressure() { return diaInput; } public void sysAvrgRead() { sysAvrg = sysAvrg / 3; System.out.println("\n" + "The systolic averge is " + sysAvrg); } public void diaAvrgRead() { diaAvrg = diaAvrg / 3; System.out.println("The diastolic averge is " + diaAvrg + "\n"); } public void setSystolic(int sys) { sysAvrg = sys; } public int getSystolic() { return sys; } } ` 元素混淆,这受限于5个嵌套级别:

  

resources属性允许您指定与正在定义的资源相关的子资源。子资源只能定义为5级深度。值得注意的是,在子资源和父资源之间不会创建隐式依赖关系。如果需要在父资源之后部署子资源,则必须使用dependsOn属性显式声明该依赖关系。

最后,我无法想象你会有超过10个嵌套模板的情况。只需考虑可维护性以及调试/排除故障部署故障的难度