- 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
- Managing IaaS and DBaaS Clouds with Oracle Enterprise Manager Cloud Control 12c
- 新形勢(shì)下中國(guó)投入產(chǎn)出核算的變革與實(shí)踐
- 自愿審計(jì)動(dòng)機(jī)與質(zhì)量研究:基于我國(guó)中期財(cái)務(wù)報(bào)告審計(jì)的經(jīng)驗(yàn)證據(jù)
- Splunk:Enterprise Operational Intelligence Delivered
- 審計(jì)綜合模擬實(shí)訓(xùn)
- Metabase Up and Running
- Microsoft System Center Data Protection Manager 2012 SP1
- vSphere Design Best Practices
- 從零開始學(xué)房地產(chǎn)會(huì)計(jì)
- 企業(yè)內(nèi)部審計(jì)全流程指南
- 政策建模技術(shù):CGE模型的理論與實(shí)現(xiàn)
- Big Data Analytics with R and Hadoop
- 計(jì)量經(jīng)濟(jì)學(xué)
- 計(jì)量經(jīng)濟(jì)學(xué)理論與應(yīng)用:基于Eviews的應(yīng)用分析