nerdexam
Microsoft

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.

Submitted by deeparc· Mar 6, 2026Secure identity and access

Question

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 another resource group where company's development resources are created. That resource group is called development-rg. The development team is assigned the Contributor role to the development-rg resource group. The development team uses three software to make regular configuration changes to the resources of development-rg, as part of their testing. They use the Azure portal, PowerShell, and Azure CLI. You want to make sure development team can work without having the existing files deleted by any user. What would you do?

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)
  • A
    9% (4)
  • B
    2% (1)
  • C
    73% (32)
  • D
    16% (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.

ARemove the development team from the Contributor role and assign them the Reader role on the

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.

BCreate a ReadOnly lock on the development-rg resource group.

A ReadOnly lock prevents all write operations, including configuration changes, which would prevent the development team from performing their testing and making necessary modifications.

CCreate a CanNotDelete lock on the development-rg resource group.Correct

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.

DCreate a custom role that contains the "Microsoft.Compute/virtualMachines/delete" operation in

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.

Full AZ-500 Practice