You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
Parameters, variables, and outputs make ARM templates flexible and reusable. Parameters accept input at deployment time, variables simplify repeated expressions, and outputs return values after deployment. In this lesson, you will learn how to use all three effectively.
Parameters allow you to provide values when deploying a template. This makes templates reusable across environments.
{
"parameters": {
"environment": {
"type": "string",
"allowedValues": ["dev", "staging", "prod"],
"defaultValue": "dev",
"metadata": {
"description": "The deployment environment"
}
},
"vmSize": {
"type": "string",
"defaultValue": "Standard_B2s",
"metadata": {
"description": "Size of the virtual machine"
}
},
"adminPassword": {
"type": "securestring",
"metadata": {
"description": "Administrator password for the VM"
}
},
"instanceCount": {
"type": "int",
"defaultValue": 2,
"minValue": 1,
"maxValue": 10,
"metadata": {
"description": "Number of VM instances"
}
},
"enableDiagnostics": {
"type": "bool",
"defaultValue": true
},
"tags": {
"type": "object",
"defaultValue": {
"project": "webapp",
"costCentre": "12345"
}
}
}
}
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.