Skill 3.2.3
Describe the purpose of resource locks
Key Concepts
There are two types of lock. CanNotDelete, shown as Delete in the portal, lets authorized users read and modify a resource but not delete it. ReadOnly lets authorized users read a resource but not delete or update it, similar to restricting everyone to the Reader role. Locks can be applied to a subscription, a resource group or an individual resource, but not to a management group, and are inherited by resources at lower levels.
Locks apply to everyone, including subscription Owners, because they act on the resource rather than on a person. To delete or change a locked resource, someone with permission must first remove the lock (which requires the Owner or User Access Administrator role, or a custom role with lock permissions) and then perform the action. This extra deliberate step is the point: it protects critical resources, such as a production database or a virtual network, from mistakes. Locks apply to management operations, not to the data inside a resource.