Resource Groups Locks prevent accidental deletion or changes to resources in Azure.
As an administrator, you may need to lock a subscription, resource group, or resource to prevent other users in your organization from accidentally deleting or modifying critical resources.
You can set the lock level to CanNotDelete or ReadOnly. In the portal, the locks are called Delete and Read-only respectively.
- CanNotDelete means authorized users can still read and modify a resource, but they can’t delete the resource.
- ReadOnly means authorized users can read a resource, but they can’t delete or update the resource. Applying this lock is similar to restricting all authorized users to the permissions granted by the Reader role.
This blog post shows how to Lock resources to prevent unexpected changes resource in Azure
Create resource group
Sign in to the Azure portal at https://portal.azure.com with your Azure account.
On the left pane of the dashboard, click Resource Groups
Double-Click on the resource group
In the Settings blade for the resource group, select Locks.
To add a lock, select Add.
Give the lock a name and lock level. Optionally, you can add notes that describe the lock and Click
The Lock is successfully created
To delete the lock, select the ellipsis and Delete from the available options.