AZ-500 · Question #260
A company has a single Azure subscription on resources are deployed. There is a resource group where company's production resources are created. That resource group is called production-rg. There is…
The correct answer is C. Create a CanNotDelete lock on the development-rg resource group. To prevent the development team from deleting resources within a specific resource group while still allowing configuration changes, create a CanNotDelete lock on that resource group.
Question
Options
- ARemove the development team from the Contributor role and assign them the Reader role on the
- BCreate a ReadOnly lock on the development-rg resource group.
- CCreate a CanNotDelete lock on the development-rg resource group.
- DCreate a custom role that contains the "Microsoft.Compute/virtualMachines/delete" operation in
How the community answered
(44 responses)- A9% (4)
- B2% (1)
- C73% (32)
- D16% (7)
Why each option
To prevent the development team from deleting resources within a specific resource group while still allowing configuration changes, create a CanNotDelete lock on that resource group.
Removing the development team from the Contributor role and assigning them the Reader role would prevent all configuration changes, not just deletions, which contradicts the requirement for them to make regular changes.
A ReadOnly lock prevents all write operations, including configuration changes, which would prevent the development team from performing their testing and making necessary modifications.
A CanNotDelete Azure resource lock prevents any user, regardless of their Azure RBAC permissions like Contributor, from deleting the locked resource or any resources within a locked scope like a resource group, while still permitting all other read and modify operations.
Creating a custom role that *contains* the delete operation does not prevent deletion; to prevent deletion using roles, you would remove the delete operation, but an Azure lock is a more direct and effective way to prevent deletion across all users, overriding RBAC delete permissions.
Concept tested: Azure resource locks for preventing deletion
Source: https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/lock-resources
Community Discussion
No community discussion yet for this question.