AZ-104 practice question · Manage Azure identities and governance
An operations team must be able to start and restart existing Azure VMs in a resource group, but must not be able to…
An operations team must be able to start and restart existing Azure VMs in a resource group, but must not be able to create, modify, or delete VMs. Built-in roles such as Virtual Machine Contributor grant more than this. What should you do?
- ACreate a custom role whose Actions list only VM read, start, and restart operations, and assign it
- BAssign the built-in Virtual Machine Contributor role at the resource group scope
- CAssign Contributor and apply a CanNotDelete lock to the resource group
- DAssign the Reader role and add start and restart operations to its NotActions
Show the answer and explanation
Correct answer: A) Create a custom role whose Actions list only VM read, start, and restart operations, and assign it
When no built-in role matches a least-privilege need, create a custom Azure RBAC role. List only the required operations in Actions, here VM read, start, and restart, and set AssignableScopes to control where it can be assigned.
Why each option is right or wrong
- A) Correct. Custom roles exist for cases where built-in roles don't fit. Their Actions can list only operations such as Microsoft.Compute/virtualMachines/start/action and restart/action, plus read permissions. AssignableScopes controls where the role can be assigned. Microsoft's own custom-role example ("Virtual Machine Operator") follows this pattern.
- B) Incorrect. Virtual Machine Contributor includes Microsoft.Compute/virtualMachines/write and /delete, so the team could create, change, and delete VMs. That breaks the requirement.
- C) Incorrect. The lock blocks deletion for everyone, including legitimate administrators. Contributor would still let the team create and modify VMs and other resources, so this is not least privilege.
- D) Incorrect. Built-in roles can't be edited. NotActions also only removes operations from the allowed Actions; it never grants extra permissions.
- Exam domain
- Manage Azure identities and governance · 25% of AZ-104
- Question type
- Multiple choice (one answer)
Related AZ-104 questions
- A production resource group must be protected against accidental deletion, while still allowing resources inside it to…Manage Azure identities and governance
- An engineer must create and manage user accounts and groups in Microsoft Entra ID but must not have any permissions on…Manage Azure identities and governance
- You are implementing hybrid identity with Microsoft Entra Connect. The security team requires that user passwords be…Manage Azure identities and governance
- You assign an Azure Policy definition with a deployIfNotExists effect that configures diagnostic settings on resources.Manage Azure identities and governance
All 62 free AZ-104 questions by domain · 15 sample questions on one page
Practise the full AZ-104 exam
This question is one of a small free sample from the CertRidge AZ-104 bank. Full practice exams match the real exam's length, time limit and domain weights, explain every option, and Review Mode re-drills the questions you miss.
Original question written from the official exam guide. Not affiliated with Microsoft; never copied from the real exam.
Worth reading: AZ-104 passing score (700/1000), what 700 means on Microsoft's scaled score, and why it isn't 70%.