Question 160
A platform team wants all resources currently in resource group rg-secure, and resources created there later, to inherit the same deletion protection. Where should a CanNotDelete lock be applied?
Explanation
Correct Answer
Azure management locks assigned to a parent scope are inherited by resources contained in that scope, including resources added after the lock is created. Applying CanNotDelete at rg-secure therefore gives consistent management-plane deletion protection without separately attaching a lock to each present and future resource. Review which child resource types and related extension resources will be affected. The lock does not restrict authorized data-plane deletion for services such as Blob Storage, so data lifecycle protection requires additional controls.
Incorrect Answers
Microsoft Entra directory roles and settings are not the Azure Resource Manager scope for locking a resource group's infrastructure. The deletion restriction must be applied in the Azure management hierarchy that contains rg-secure. A lock on the group is inherited by its resources; a directory configuration would not substitute for it.
A lock on an individual storage account applies to that resource and relevant descendants or extension resources, not to sibling VMs or future resources elsewhere in the group. The team wants group-wide deletion protection. Put the CanNotDelete lock on rg-secure rather than on an arbitrary child resource.
Individual VM locks would protect those current resources but would not automatically cover newly created storage accounts, databases, or other resources in the group. The requirement explicitly includes future descendants. A resource-group-level CanNotDelete lock provides inherited protection at the intended common scope.