An administrator needs to configure access and compliance for a development team. The requirements are:
1. A developer named Casey must be able to create and manage virtual machines within a resource group named Dev-RG.
2. Casey must not be allowed to grant other users access to the resource group.
3. The team must be prevented from deploying virtual machines that do not match a specific size configuration.
Which configuration should the administrator implement to meet these requirements?
- Assign Casey the Contributor role for Dev-RG, and assign an Azure Policy definition to prevent the deployment of non-compliant virtual machine sizes.Answer
- BAssign Casey an Azure Policy definition that grants resource creation permissions, and assign another Azure Policy definition to prevent the deployment of non-compliant virtual machine sizes.
- CAssign Casey the Contributor role for Dev-RG, and apply a ReadOnly resource lock to Dev-RG to prevent unauthorized modifications to the virtual machines.
- DAssign Casey the Contributor role for Dev-RG, and rely on Azure Policy to automatically delete any non-compliant virtual machines after they are deployed.
Answer
Assign Casey the Contributor role for Dev-RG, and assign an Azure Policy definition to prevent the deployment of non-compliant virtual machine sizes.
The correct configuration assigns Casey the Contributor role at the resource group scope, which permits full resource management (creation, deletion, modification) while preventing Casey from granting access to other users (a permission reserved for Owner or User Access Administrator roles). It also uses Azure Policy to enforce the VM size constraint, as RBAC cannot restrict resource properties like sizes.
Step-by-Step Solution
Key Concept
Azure Role-Based Access Control (RBAC) vs Azure Policy