Structure and Syntax of ARM Templates
- Refer Here for the official documentation
- The skeleton
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "",
"apiProfile": "",
"parameters": { },
"variables": { },
"functions": [ ],
"resources": [ ],
"outputs": { }
}
- ARM Template Elements
- $schema: Describes the version of template language. The version used depends on the scope of deployment and JsonEditior

- contentVersion: This represents the version of template. We can provide any value for this generally the following notation (x.x.x.x => 1.0.0.1) is recommended
- apiProfile: An API version that servers collection of API versions for resource types
- parameters: Values that are provided when deployment is executed
- variables: Used and created within template to simplify template expressions
- functions: User-defined functions that are available within the template
- resources: Resource Types that are deployed or updated in Resource group or subscription
- outputs: values are returned after deployment
- $schema: Describes the version of template language. The version used depends on the scope of deployment and JsonEditior
Setting up Visual Studio code for ARM Templates
- Install Azure Resource Manager tools extension

- This extension will help in authoring/developing arm templates
Activity 1: Create a Virtual Network
-
Lets try to create an ARM Template which will create a Virtual Network with 2 subnets
- Virtual Network cidr range => 10.10.0.0/16 (10.10.0.0 – 10.10.255.255)
- web subnet cidr range => 10.10.0.0/24 (10.10.0.0 – 10.10.0.255)
- app subnet cidr rnage => 10.10.1.0/24 (10.10.1.0 – 10.10.1.255)
-
Manual Steps:

-
In this example we are creating a virtual network with two subnets. The main resource which we are creating is a virtual network
-
Writing ARM Template
- Create a json file and create and empty template (arm!)
- Virtual network resource documentation Refer Here
- Refer Here for the tempalte created in the class
- Steps:
- Create-> Template Depoyment

