ARM Template Structure
- ARM Template is a json file that defines the infrastructure which you want to create
- Refer Here to understand the syntax of ARM Template
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "",
"apiProfile": "",
"parameters": { },
"variables": { },
"functions": [ ],
"resources": [ ],
"outputs": { }
}
- $schema:
- Required
- Location of the JSON schema file
- For subscription deployments, use:
https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json# - Use https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json# for Resource Group deployments
- contentVersion:
- Required
- This is version for users reference (1.0.0.0)
- apiProfie:
- Optional
- An api version that serves collection of resource types
- parameters:
- optional
- Values that can be provided when deployment is executed to customize resource deployment
- variables:
- Optional
- Values used as Json elements in the template to simplify template language expressions
- functions:
- optional
- User defined functions
- resources:
- required
- Resource types that are deployed or updated in a resource group
- outputs:
- optional
- Values returned after deployment
Activity 1: Lets create a virtual network using ARM Template
- Manual steps:
- Create a resource group
- Inputs:
- Location
- Resource Group
- Name of Vnet
- address space of virtual network
- subnets
- Lets try to write an ARM Template for this
- Create the basic skeleton with only required fields Refer Here
- For creating resources we would be using template reference Refer Here
- For virtual network Refer Here
- Refer Here for the changes done.
- Now create a resource group, as we are going to do resource group deployment
- Now create a custom template deployment