The procedure for creating a resource group lock is the same as the subscription lock – the only change is the place where the lock is applied. To add a lock from the Azure portal, follow these steps:
- Go to your resource group and find the Locks blade:
Figure 2.12: Locks blade
- The rest is the same as in the Subscription lock section. When browsing a resource group lock, you will be able to also see the locks that have been applied at the subscription level:
Figure 2.13: Resource group locks view
Performing the same operation from the CLI is even easier – you only need a single command where you pass the name of a lock (the -n parameter), its type (-t), and the resource group (-g) that it will be applied to:
$ az lock create -n "Read-only_RG" -t "ReadOnly" --resource-group "azureadministrator-euw-rg"
The result of creating such a lock is a JSON representation of a created...