Course contentsShow
← Cloud and Infrastructure
Lesson 897 of 2,98917. Azure ARM Templates and BicepFree lesson

Parameters in ARM Templates

Define template parameters with types, default values, and allowed values for reusability.

What You'll Learn

You'll learn how to make your Azure ARM templates flexible and reusable by defining parameters that accept input values when deploying resources.

What Are ARM Template Parameters?

Parameters are the variables in your ARM template that let users customize deployments without editing the template itself. Think of them like a form you fill out before ordering a product—you choose size, color, and quantity, but the product design stays the same.

Instead of hard-coding values like VM sizes or location names, parameters let the same template deploy different configurations based on user input at deployment time.

Defining Parameters

Parameters live in the "parameters" section of your ARM template. Each parameter has:

  • Name: The identifier you'll reference throughout the template
  • Type: What kind of value (string, int, bool, array, object)
  • DefaultValue (optional): Value used if none provided
  • AllowedValues (optional): List restricting choices

Here's what a parameter definition looks like:

"parameters": {
  "vmSize": {
    "type": "string",
    "defaultValue": "Standard_B2s",
    "allowedValues": [
      "Standard_B2s",
      "Standard_D2s_v3",
      "Standard_F4s"
    ],
    "metadata": {
      "description": "Size of the virtual machine"
    }
  }
}

How Parameters Enable Reusability

With parameters, one template becomes many. You can deploy dev environments with small VMs and production with large ones—same template, different parameter values. The allowedValues constraint acts as guardrails, preventing invalid inputs like unsupported VM sizes.

Key Takeaway: Parameters transform rigid ARM templates into flexible, reusable infrastructure blueprints by accepting typed inputs with optional defaults and validation constraints—making the same template work across multiple environments and scenarios.