Articles → MICROSOFT AZURE → Apply Locks To A Resource Group Using The ARM Template In Azure
Apply Locks To A Resource Group Using The ARM Template In Azure
Creation Of The Resource Group
Click to Enlarge
Deploy Using ARM
Click to Enlarge
Click to Enlarge
Click to Enlarge
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
"apiVersion": "2021-04-01",
"name": "RG1111",
"location": "eastus",
"properties": {}
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2021-04-01",
"name": "lockDeployment",
"resourceGroup": "RG1111",
"dependsOn": [
"RG1111"
],
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"type": "Microsoft.Authorization/locks",
"apiVersion": "2016-09-01",
"name": "rgLock",
"properties": {
"level": "CanNotDelete",
"notes": "Resource group and its resources should not be deleted."
}
}
],
"outputs": {}
}
}
}
],
"outputs": {}
}
Click to Enlarge
Click to Enlarge
Click to Enlarge
Click to Enlarge