hi i am tried to lock a resource group in azure using ARM template but i am not able do so please help me if anyone already familiar.
We can use template to lock resource group directly without creating storage account.
The next example applies a read-only lock to the resource group:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"type": "Microsoft.Authorization/locks",
"apiVersion": "2015-01-01",
"name": "MyGroupLock",
"properties":
{
"level": "ReadOnly",
"notes": "my notes"
}
}
],
"outputs": {}
}
See more details about how to lock resource and resource group with template in this article.