Bitzu

AZ-900 ยท Governance and compliance

Resource locks

CanNotDelete (Delete) and ReadOnly locks, applying them at subscription, resource group or resource, inheritance, and that even owners must remove a lock first.

Key points

  • Two levels: CanNotDelete ("Delete" in the portal) allows reads and changes but blocks deletion; ReadOnly ("Read-only") allows reads only.
  • Locks can be set on a subscription, resource group or resource, are inherited by everything below, and apply to all users and roles: even an Owner must remove the lock first.

Source: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/lock-resources

Practice questions

Single choice

Which lock lets users keep changing a resource but stops anyone from deleting it?

  1. ReadOnly
  2. CanNotDelete
  3. NoModify
  4. Reader
Show answer

Answer: B. CanNotDelete

CanNotDelete allows reads and modifications but blocks deletion. ReadOnly blocks changes as well; the Reader role is RBAC, not a lock.

Select all that apply

At which scopes can you apply a resource lock?

  1. Subscription
  2. Resource group
  3. Individual resource
  4. Management group
  5. Microsoft Entra tenant
Show answer

Answer: A. Subscription, B. Resource group, C. Individual resource

Locks can be placed on a subscription, a resource group or a single resource. Management groups cannot be locked, and a Microsoft Entra tenant is not an Azure Resource Manager scope for locks.

True or false

A user with the Owner role can delete a resource that has a CanNotDelete lock without removing the lock first.

Show answer

Answer: False

False. Locks apply to all users and roles and override permissions; the Owner can remove the lock, but the delete only works after that.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More AZ-900 topics in this module