Up:: Microsoft Azure Developer Associate AZ-204 2023

Azure Arm Templates

Introduction to ARM Templates

  • What Is IaC (Infrastruction as Code)
    • managing and provisioning computer data centers using scripts or machine readable definition files like JSON
    • Two types
      • Declarative - Know exactly what you want
      • Imperative - Know some of what you want and service fills in the blanks
  • ARM Templates are JSON files that define azure resources
    • declarative
    • reduce configuration mistakes
  • With ARM templates your can
    • declarative
    • establish base line for compliance
    • Modularity
  • Skeleton
    • $schema - rules for definition
    • contentVersion - version of the template
    • apiProfile -
    • parameters
    • variables
    • functions
    • resources
    • outputs
  • ARM Template Resources
    • Resource you want to provision
      • type
      • apiVersion
      • name - has to be unique
      • location - region to deploy in
      • Other properties - dependant on resource type
  • ARM Template Paramaters
    • pass variables to the ARM Template
      • type
      • defaultValue
      • allowedValues
      • minValue
      • maxValue
      • minLength
      • maxLength
      • description
  • ARM Template Functions
    • Allow transformations for variables
      • Built In Functions
        • Array
        • Comparison
        • Date
        • Deployments
        • Logical
        • Numerical
        • Object
        • Resource
        • String
  • ARM Templates Variables
    • Used to simplify ARM Templates
  • ARM Templates Outputs
    • Return values from deployed resource so you can use it programmatically
  • 02:47:13 ARM Templates Follow Along
    • Search for Deployments
    • Select Custom Templates
    • Add resource by using the Add Resource button
    • Copy Code to save to change later, templates once saved can’t be edited
    • Use Worf for all inputs
    • Template generated has the wrong VM Size in the variables
    • Deploys all it can
    • No Rollback feature
    • Have to delete all resources and template to replace template
    • Export resource group items as template to use them later - Good for exporting
  • ARM Templates Cheat Sheet
    • IaC
      • Declarative
      • Imperative
    • JSON Files
    • Know the structure of the templates

Additional Metadata