FREE STUDY NOTES · AZ-900

Azure resource locks: CanNotDelete vs ReadOnly

How resource locks prevent accidental deletion or change, how they inherit, and how they differ from RBAC and Policy.

From Ultra Transcenders AZ-900 by Tony Rough (publishing soon)

Even people with the right permissions make mistakes, such as deleting the wrong resource group. A resource lock protects a subscription, resource group or resource from accidental deletion or modification, and it overrides user permissions.

Lock (portal name / command-line name) Read Modify Delete
Delete / CanNotDelete Yes Yes No
Read-only / ReadOnly Yes No No

Key behaviour:

One-line CLI example: az lock create --name LockGroup --lock-type CanNotDelete --resource-group rg-app

Common trap: Believing an Owner can delete a resource that has a Delete lock - locks apply regardless of RBAC role; even an Owner must remove the lock first.

Common trap: Relying on a lock to protect the data stored in a resource - locks apply only to control-plane (management) operations; data-plane operations such as deleting blobs or database rows are not blocked.

Get the whole book

This note is one section of Ultra Transcenders AZ-900: Microsoft Azure Fundamentals, an independent study guide that explains every topic the exam covers by technology, with comparison tables, diagrams and the common traps, plus a glossary linked to Microsoft Learn.

Amazon.co.ukKindle: coming soonPaperback: coming soon
Amazon.comKindle: coming soonPaperback: coming soon

Publishing soon on Amazon in Kindle and paperback editions.

About the book · AZ-900 terms in the glossary · All AZ-900 study notes

More AZ-900 study notes