Administrators can set locks on your Azure resources to prevent other users from deleting the resource or making any changes to it. You can set two different lock levels on your subscriptions, resource groups, or resources:
- CanNotDelete: This level prevents authorized users from deleting the resource. They can still read and modify the resource.
- ReadOnly: Within this level, authorized users can read a resource, but they cannot delete or update it. This level is similar to assigning all authorized users to the reader role using RBAC.
To apply a lock on your resource group, you have to perform the following steps:
- Navigate to the Azure portal by opening https://portal.azure.com.
- In the left-hand menu, select Resource groups. Select the resource group that we created in the previous demonstration.
- In the Resource Group overview blade, under Settings...