Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Resource Group Lock using ARM Template

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.

like image 273
Devendra Pal Singh Avatar asked Aug 15 '26 05:08

Devendra Pal Singh


1 Answers

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.

like image 157
Wayne Yang Avatar answered Aug 16 '26 18:08

Wayne Yang



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!