CodeMIRAI
0 XP

Infrastructure as code and ARM templates

2 min read Quiz included

Infrastructure as code (IaC)

Infrastructure as code means describing your infrastructure (networks, VMs, databases) in code files instead of creating it by hand. The files can be stored in source control, reviewed, reused and deployed again and again with the same result.

Benefits:

  • Repeatable and consistent: every deployment creates the same environment, with no forgotten clicks.
  • Version-controlled: changes are tracked and can be rolled back.
  • Fast: whole environments can be created (or torn down) in minutes.
  • Reviewable: infrastructure changes go through the same review as code.

Azure Resource Manager (ARM)

Azure Resource Manager is the deployment and management service for Azure. Every request to create, change or delete a resource, whether from the portal, the CLI, PowerShell, an SDK or a template, goes through Resource Manager, which authenticates and authorises it.

Because everything passes through one layer, you get consistent results and features such as:

  • managing resources as a group instead of one by one,
  • role-based access control, tags and resource locks applied consistently,
  • understanding dependencies between resources,
  • deploying with templates.
ToolsOne management layerResourcesAzure portalAzure CLIAzure PowerShellSDKs and RESTARM templates, BicepAzure Resource Managerauthenticates youchecks RBAC and locksapplies Azure Policydeploys in orderVirtual machinesStorageNetworksDatabases
Because every tool goes through the same layer, access control, locks, policies and tags apply the same way whichever one you use.

ARM templates

An ARM template is a JSON file that defines the resources you want to deploy. ARM templates are declarative: you describe what you want (the end state), not how to create it step by step. Resource Manager works out the order and the steps.

Key benefits the exam mentions:

  • Declarative syntax
  • Repeatable results: deploy the same template many times, getting the same state
  • Orchestration: Resource Manager deploys resources in the right order, in parallel where possible
  • Modular files: break templates into smaller, reusable pieces
  • Extensibility: run scripts during deployment
JSON
{
  "type": "Microsoft.Storage/storageAccounts",
  "apiVersion": "2023-01-01",
  "name": "stlearn2026",
  "location": "eastus",
  "sku": { "name": "Standard_LRS" },
  "kind": "StorageV2"
}

Bicep

Bicep is a newer language for declaring Azure resources with a simpler, more readable syntax than JSON. Bicep files are converted into ARM templates when deployed, so they get all the same benefits.

Bicep
resource storage 'Microsoft.Storage/storageAccounts@2023-01-01' = {
  name: 'stlearn2026'
  location: 'eastus'
  sku: { name: 'Standard_LRS' }
  kind: 'StorageV2'
}
Finished this lesson?Mark it complete to earn +20 XP and move your progress on.