Resource locks (CanNotDelete and ReadOnly)
Facts read 10 Nov 2026. Page reviewed 16 Nov 2026.
Resource locks (CanNotDelete and ReadOnly) is an Azure guardrail written in Azure resource locks. A CanNotDelete lock stops deletion and a ReadOnly lock stops updates and deletion of a subscription, resource group or resource, overriding user permissions. No documented way to test it before enforcement was found on 10 Nov 2026.
More organization integrity guardrails ยท About Azure resource locks
CanNotDelete means authorized users can read and modify a resource, but they can't delete it.
ReadOnly means authorized users can read a resource, but they can't delete or update it. Applying this lock is similar to restricting all authorized users to the permissions that the Reader role provides.
Bicep example from the documentation:
resource createRgLock 'Microsoft.Authorization/locks@2016-09-01' = {
name: 'rgLock'
properties: {
level: 'CanNotDelete'
notes: 'Resource group should not be deleted.'
}
}
- Blocks
- A CanNotDelete lock stops deletion and a ReadOnly lock stops updates and deletion of a subscription, resource group or resource, overriding user permissions.
- Breaks
- A read-only lock on a resource group that contains a virtual machine prevents all users from starting or restarting it, because those operations use POST requests. (source)
- Test before applying
- As for every Azure resource locks guardrail: how to test before enforcing
- Mechanism
- Azure resource locks: Control plane operations on the locked scope and the resources under it
- Taken from
- provider documentation, provider documentation
What the source says
"ReadOnly means authorized users can read a resource, but they can't delete or update it." (read 10 Nov 2026).
On what it breaks: "A read-only lock on a resource group that contains a virtual machine prevents all users from starting or restarting a virtual machine. These operations require a POST method request."
Related guardrails
- Deny member accounts leaving the organizationAWS, Service control policies (SCPs), organization integrity
- Deny billing, tax and account contact changesAWS, Service control policies (SCPs), organization integrity
- Restrict access to resources in a suspended OUAWS, Resource control policies (RCPs), organization integrity
- Do not allow deletion of resource typesAzure, Azure Policy (built-in definitions), organization integrity
- Deployment stack deny settings (Azure RBAC deny assignment)Azure, Azure RBAC deny assignments (created by deployment stacks), organization integrity
Related pages
Sources
- Resource locks (CanNotDelete and ReadOnly), read 10 Nov 2026
Last reviewed 16 Nov 2026.