Infra Provisioning using ARM Templates
- Azure supports infraprovisioning in 3 popular ways
- ARM Templates:
- Azure Bicep
- Azure Provider in Terraform
- ARM Templates can be applied at resource group or subscription or management group level
- Refer Here for creating an ARM Template from vscode
- Ensure extenison is installed

- resource definitins Refer Here
- Template reference Refer Here
- ARM Template resource syntax for virtual network Refer Here
- Create a new folder and any json file. Add vnet as discussed in the class
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2023-04-01",
"name": "test",
"location": "East US",
"properties": {
"addressSpace": {
"addressPrefixes": ["192.168.0.0/16"]
}
}
}
]
}
- Create a new resource group and deploy custom template




Activity 1: Create a storage account using ARM Template
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"functions": [],
"variables": {},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2022-09-01",
"name": "qtstorfromarmdec23",
"location": "East US",
"sku": {
"name": "Standard_GZRS"
},
"kind": "StorageV2",
"properties": {
"accessTier": "Hot"
}
}
],
"outputs": {}
}
Activity 2: Create vnet and storage account with parameters
- Refer Here for parameter declaration
- In the below template i have written two paramters
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageaccname": {
"type": "string",
"metadata": {
"description": "name of the storage account"
},
"defaultValue": "qtstorfromarmdec23"
},
"sku": {
"type": "string",
"metadata": {
"description": "sku of storage account"
},
"allowedValues": [
"Premium_LRS",
"Premium_ZRS",
"Standard_GRS",
"Standard_GZRS",
"Standard_LRS",
"Standard_RAGRS",
"Standard_RAGZRS",
"Standard_ZRS"
]
}
},
"functions": [],
"variables": {},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2022-09-01",
"name": "[parameters('storageaccname')]",
"location": "East US",
"sku": {
"name": "[parameters('sku')]"
},
"kind": "StorageV2",
"properties": {
"accessTier": "Hot"
}
},
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2023-04-01",
"name": "test",
"location": "East US",
"properties": {
"addressSpace": {
"addressPrefixes": [ "192.168.0.0/16" ]
}
}
}
],
"outputs": {}
}
- Lets try deploying

Activity 3: Create a virtual network with 3 subnets in ARM Template
- Create a virtual network with address space
10.100.0.0/16 and 3 subnets
- web:
10.100.0.0/24
- business:
10.100.1.0/24
- data:
10.100.2.0/24
- For ui references Refer Here
- Note: ignore bastion host.
Like this:
Like Loading...