Contoso has a resource group named RG1 that contains virtual machines and a web app. No one, including users with the Owner role, may delete the resources in RG1 or resources added to it later. Operators must still be able to change resource settings. What should you do?
Show answer and explanation
Answer: B
Explanation
A CanNotDelete lock (called Delete in the portal) lets authorized users read and modify a resource but blocks deletion. A lock overrides any user permissions and, unlike RBAC, applies across all users and roles, so even an Owner can’t delete the resources while the lock is in place.[1] A lock applied to a resource group is inherited by all resources in it, including resources added later.[1]
A ReadOnly lock (called Read-only in the portal) blocks updates as well as deletions, so option A doesn’t meet the requirement to change settings.[1] On a resource group that contains virtual machines, it also prevents all users from starting or restarting them.[1] You can’t add a lock to management groups, so option C can’t be configured.[1] The Reader role lets you view all resources but doesn’t allow you to make any changes, so option D doesn’t meet the requirement to change settings.[2]