MultiCloud Classroom notes 19/Feb/2026

#ARM

Azure Resource Manager (ARM) Templates

Overview

Azure Resource Manager (ARM) templates are JSON files that declare the desired state of Azure infrastructure. Developers define resources and configurations, submit the template to ARM, and Azure provisions and configures everything automatically. This is declarative Infrastructure as Code.


Introduction to ARM Templates

  • Describe what to deploy, not how to deploy.
  • Enable repeatable, idempotent deployments across environments.
  • Support dependencies, parameterization, and outputs for modular, reusable infrastructure.

How to Write ARM Templates

  • Define parameters for environment-specific values.
  • Add variables for computed names/strings.
  • List resources with types, API versions, properties, and dependencies.
  • Include outputs to return IDs, connection strings, etc.
  • Validate and deploy via Azure CLI / PowerShell / Portal.

Template Structure and Anatomy

  • $schema: Template schema URL.
  • contentVersion: Your version tag (e.g., 1.0.0.0).
  • parameters: Inputs (names, types, defaults).
  • variables: Derived values.
  • functions: Built-in and user-defined template functions.
  • resources: Array of resource declarations.
  • outputs: Values returned after deployment.

Core Properties and Uses

  • $schema: Enables tooling validation.
  • contentVersion: Controls versioning.
  • parameters: e.g., location, names, sizes.
  • variables: String concat, resource names.
  • resources: type, apiVersion, name, location, properties, dependsOn.
  • outputs: Expose resource data (IDs, endpoints).
  • functions: concat, format, reference, resourceId, listKeys, if, copy loops.

{
  "$schema": "",
  "contentVersion": "",
  "parameters": {},
  "variables": {},
  "functions": [],
  "resources": [],
  "outputs": {}
}



Practical Examples

Storage Account

{
  "type": "Microsoft.Storage/storageAccounts",
  "apiVersion": "2023-01-01",
  "name": "[parameters('storageName')]",
  "location": "[parameters('location')]",
  "sku": { "name": "Standard_LRS" },
  "kind": "StorageV2"
}



ARM template for storage account

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "dev-Type": {
            "type": "string",
            "defaultValue": "Standard_LRS",
            "allowedValues": [
                "Standard_LRS",
                "Standard_ZRS",
                "Standard_GRS",
                "Standard_RAGRS",
                "Premium_LRS"
            ]
        }
    },
    "resources": [
        {
            "name": "[variables('dev-Name')]",
            "type": "Microsoft.Storage/storageAccounts",
            "location": "[resourceGroup().location]",
            "apiVersion": "2015-06-15",
            "dependsOn": [],
            "tags": {
                "displayName": "dev-"
            },
            "properties": {
                "accountType": "[parameters('dev-Type')]"
            }
        }
    ],
    "variables": {
        "dev-Name": "[concat('dev-', uniqueString(resourceGroup().id))]"
    }
}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Please turn AdBlock off
Plugin for Social Media by Acurax Wordpress Design Studio

Discover more from Direct DevOps from Quality Thought

Subscribe now to keep reading and get access to the full archive.

Continue reading

Visit Us On FacebookVisit Us On LinkedinVisit Us On Youtube