Skip to content
Learni
View all tutorials
Cloud & DevOps

How to Deploy ARM Infrastructure on Azure in 2026

Lire en français

Introduction

Azure Resource Manager (ARM) is the deployment and resource management service for Azure. ARM templates let you describe complete infrastructure as JSON code, ensuring reproducible, traceable, and compliant deployments. In 2026, ARM remains essential for enterprise environments that require fine-grained control and strict governance. This tutorial guides you step by step through creating professional templates, from simple models to multi-resource scenarios with parameters and outputs.

Prerequisites

  • Azure account with Contributor permissions
  • Azure CLI 2.50+ or Azure PowerShell
  • Basic knowledge of JSON and Azure resources
  • Code editor (VS Code recommended with Azure extension)

Create the basic ARM template

main.json
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "storageAccountName": {
      "type": "string",
      "minLength": 3,
      "maxLength": 24
    }
  },
  "resources": [
    {
      "type": "Microsoft.Storage/storageAccounts",
      "apiVersion": "2023-01-01",
      "name": "[parameters('storageAccountName')]",
      "location": "[resourceGroup().location]",
      "sku": {
        "name": "Standard_LRS"
      },
      "kind": "StorageV2",
      "properties": {}
    }
  ]
}

This minimal JSON template creates a storage account. The schema and content version are mandatory. Parameters enable template reuse.

Add a parameters file

parameters.json
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "storageAccountName": {
      "value": "learniarmdemo2026"
    }
  }
}

The parameters.json file separates values from the template. This allows reusing the same template across different environments (dev, prod).

Deployment via Azure CLI

deploy.sh
#!/bin/bash
RG_NAME="rg-arm-demo"
LOCATION="westeurope"

az group create --name $RG_NAME --location $LOCATION
az deployment group create \
  --resource-group $RG_NAME \
  --template-file main.json \
  --parameters @parameters.json

This Bash script creates the resource group then deploys the template. Always validate the template before deploying to production.

Add outputs to the template

main.json
{
  "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "storageAccountName": {
      "type": "string"
    }
  },
  "resources": [
    {
      "type": "Microsoft.Storage/storageAccounts",
      "apiVersion": "2023-01-01",
      "name": "[parameters('storageAccountName')]",
      "location": "[resourceGroup().location]",
      "sku": { "name": "Standard_LRS" },
      "kind": "StorageV2",
      "properties": {}
    }
  ],
  "outputs": {
    "storageAccountId": {
      "type": "string",
      "value": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
    }
  }
}

Outputs expose useful values after deployment, such as resource IDs for chaining additional deployments.

Template validation

validate.sh
#!/bin/bash
az deployment group validate \
  --resource-group rg-arm-demo \
  --template-file main.json \
  --parameters @parameters.json

Validation detects syntax and dependency errors before any real deployment, avoiding unnecessary costs.

Best practices

  • Always use parameters and variables to avoid duplication
  • Add descriptions and metadata in every template
  • Version templates and follow strict naming conventions
  • Systematically test in a pre-production environment
  • Prefer Bicep for new projects while mastering ARM for legacy maintenance

Common mistakes to avoid

  • Forgetting to declare dependencies between resources (dependsOn)
  • Hardcoding resource names instead of using parameters
  • Skipping template validation beforehand
  • Not handling deployment errors with conditional scripts

Going further

Deepen your ARM and Bicep skills with our expert training. Discover our Learni courses.

How to Deploy ARM Templates on Azure in 2026 | Learni