Skip to content
Cloud Governance Tools

Resource locks (CanNotDelete and ReadOnly)

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."

Sources

  1. Resource locks (CanNotDelete and ReadOnly), read 10 Nov 2026

Last reviewed 16 Nov 2026.