- Learn Azure Administration
- Kamil Mrzyg?ód
- 355字
- 2021-06-11 18:14:31
Subscription locks
Each lock is a separate resource and is available on either a subscription, resource group, or a resource level. In this section, we will cover working with them using Azure portal, but under the hood, locks are just Azure resources that are accessible via the ARM API. If you want to create a lock, follow these steps:
- If you go to your subscription, you can find the Resource locks blade in the Settings section:

- From the new screen, you can click on the + Add button, where you will able to enter the lock's properties:

Adding a lock requires that you provide the following information:
-
- Lock name: The unique lock name across the given scope
- Lock type: Determines the behavior of a lock
- Notes: Optional notes
Once you click the OK button, a lock will be applied on the subscription level and a specific action (changes/deletion) will become forbidden.
- The same can be done from the Azure CLI level. To list all the locks, you can use the following command:
$ az lock list
- Since we are using an Azure CLI command without providing an output type, the default result representation is a JSON document. It contains information about the full identifier of the lock (id), its type (the level parameter) and additional information (such as a description and its name):
[
{
"id": "/subscriptions/.../providers/Microsoft.Authorization/locks/Delete",
"level": "CanNotDelete",
"name": "Delete",
"notes": "Delete lock for the subscription",
"owners": null,
"type": "Microsoft.Authorization/locks"
}
]
- Now, to create a new one, execute the following command:
$ az lock create -n "Read-only" -t "ReadOnly"
Now, you should be able to see the result of creating a read-only lock. Since we only provided the name (-n) and lock type (-t), only those fields will be filled in inside the JSON document:
{
"id": "/subscriptions/.../providers/Microsoft.Authorization/locks/Read-only",
"level": "ReadOnly",
"name": "Read-only",
"notes": null,
"owners": null,
"type": "Microsoft.Authorization/locks"
}
Now, let's look at resource group locks, which are more focused locks. This is because they're only applied at the resource group level.
- Mastering Microsoft Forefront UAG 2010 Customization
- 一本書學內部審計:新手內部審計從入門到精通
- Pentaho Business Analytics Cookbook
- 汪博士詳解PMP?模擬題(第4版)
- 新中國審計制度變遷
- Metabase Up and Running
- Business Intelligence with MicroStrategy Cookbook
- 國家治理能力視角的國家審計功能理論研究
- Microsoft Dynamics CRM 2011 Scripting Cookbook
- 財務審計實務指南
- 陜西國家統計調查市、縣優秀報告集萃(2006—2015)(上下)
- 內審人員進階之道:內部審計操作實務與案例解析
- 內部審計情景案例:理解審計行為,辨析審計決策
- 統計學理論前沿(谷臻小簡·AI導讀版)
- 效益實現管理實踐指南