Try a sample question
This is an original sample question written by itmoshi based on the exam objectives.
You want operator User1 to be able to start and restart the virtual machines in resource group RG-App. User1 must not be able to create or delete VMs or change disk or network settings, and must have no access at all to VMs in other resource groups. User1 currently has no role assignments of any kind: direct, through a group, or inherited from a higher scope. Which approach follows the principle of least privilege?
- AAssign User1 the Reader role at the RG-App scope
- BAssign User1 the Virtual Machine Contributor role at the subscription scope
- CCreate a custom role with only the VM read, start and restart actions and assign it at the RG-App scope
- DAssign User1 the Owner role at the RG-App scope
Show answer and explanation
Answer:C A custom role that allows only the required actions, assigned at the required scope (RG-App), is least privilege.
Why it is correct
In Azure RBAC, access is defined by two things: what can be done (the role definition) and where (the scope). A custom role whose Actions contain only Microsoft.Compute/virtualMachines/read, Microsoft.Compute/virtualMachines/start/action and Microsoft.Compute/virtualMachines/restart/action lets User1 start and restart VMs but not create, delete or reconfigure them. Assigned at the RG-App scope, and with no other assignments in place, it keeps VMs in other resource groups out of reach.
The other options
- ✗ A Reader is read-only and does not include actions such as start or restart. Use it when someone only needs to view status.
- ✗ B Virtual Machine Contributor can create, delete and reconfigure VMs, and the subscription scope covers every resource group. It suits someone responsible for VM management as a whole.
- ✗ D Owner can manage every resource in the scope and can even assign roles to others. Use it to fully delegate management of a resource group.
Key takeaway
Least privilege means narrowing both the role and the scope. When no built-in role fits exactly → create a custom role, list only the needed operations in Actions, and limit AssignableScopes and the assignment scope to what is required.
Try 53 questions like this for free
itmoshi is an unofficial study service and is not affiliated with Microsoft or any exam provider.