使用ARM模板锁定资源组

Dev*_*ngh 1 azure azure-rm-template azure-resource-group

嗨我试图使用ARM模板锁定azure中的资源组但我不能这样做,如果有人已经熟悉,请帮助我.

Way*_*ang 5

我们可以使用模板直接锁定资源组而无需创建存储帐户.

下一个示例将只读锁应用于资源组:

{
    "$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": {}
}
Run Code Online (Sandbox Code Playgroud)

请参阅有关如何锁定资源和资源组与模板的详细信息这篇文章.