Azure 资源管理器 :: 嵌套模板

Azure Resource Manager :: Nested Templates

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

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

对,没有明确的限制。如果您检查 json 架构,您将找不到任何定义的最大限制:deployment template schema。但是,Azure 部署模板的总大小有限制,不能超过 1MB:

You must limit the size your template to 1 MB, and each parameter file to 64 KB. The 1 MB limit applies to the final state of the template after it has been expanded with iterative resource definitions, and values for variables and parameters.

不要与 resources 元素混淆,它被限制为 5 层嵌套:

The resources property allows you to specify child resources that are related to the resource being defined. Child resources can only be defined 5 levels deep. It is important to note that an implicit dependency is not created between a child resource and the parent resource. If you need the child resource to be deployed after the parent resource, you must explicitly state that dependency with the dependsOn property.

最后,我无法想象有超过 10 个嵌套模板的情况。只需考虑可维护性以及 debug/troubleshoot 部署失败

的挑战性