chapter five

5 Writing advanced ARM templates

 

This chapter covers

  • Writing an ARM template that deploys to more than one scope
  • How to structure large IaC solutions into more than one template
  • Dealing with dependencies and ordering resources in a deployment
  • Advanced constructs like conditions, loops, and deployment scripts
  • How to reverse engineer existing infrastructure into an ARM template

5.1   Deploying to multiple scopes using Nested Templates

5.1.1   Nested templates on a Management Group

5.1.2   Evaluation scope

5.1.3   Outputs

5.2   How to structure solutions

5.2.1   Small to medium solutions

5.2.2   Large solutions

5.3   Modularize templates with Linked templates

5.3.1   Using a Uri

5.3.2   Using a relative path

5.4   Ordering

5.4.1   Explicit

5.4.2   Implicit

5.5   Conditions

5.5.1   Output

5.6   Loops

5.6.1   Copy on variables

5.6.2   Copy on properties

5.6.3   Copy on output

5.6.4   dependsOn

5.7   Deployment scripts

5.8   Reverse engineering a template

5.8.1   Export template

5.8.2   Resource Explorer

5.8.3   JSON View

5.8.4   On a new resource

5.9   Summary