A company has a resource group named 'RG-Prod' that contains critical virtual machines (VMs), virtual networks, and a SQL database. The infrastructure team needs to grant a group of developers the ability to start, stop, and restart only the VMs in RG-Prod. The developers must not be able to create new VMs, delete existing VMs, modify the virtual networks, or access the database. The company wants to follow the principle of least privilege. Which Azure role-based access control (RBAC) approach should the company use?
Answer choices
Why each option matters
Good practice is not just finding the correct option. The wrong answers often show the exact trap the exam wants you to fall into.
Distractor review
Assign the Virtual Machine Contributor built-in role to the developers.
Virtual Machine Contributor provides full management of VMs, including creating, deleting, and modifying VMs, as well as managing networking resources (like virtual networks and network interfaces) attached to VMs. This is too permissive and violates the principle of least privilege because it allows actions beyond starting, stopping, and restarting, and it could also allow modification of virtual networks.
Best answer
Create a custom RBAC role that includes only the specific actions required (e.g., Microsoft.Compute/virtualMachines/start/action, Microsoft.Compute/virtualMachines/deallocate/action) and assign it to the developers.
A custom RBAC role allows you to define a precise set of allowed actions. By including only the start, deallocate, and restart actions, you grant exactly the permissions needed. The role does not include write or delete actions, so developers cannot create or delete VMs. Since VNet and database actions are not included, those resources are also protected. This meets the least privilege requirement.
Distractor review
Assign the Contributor built-in role and then create an Azure Policy to deny any VM creation or deletion and VNet modifications in RG-Prod.
The Contributor role grants write permissions to all resources, including the ability to create and delete VMs and modify VNets. While Azure Policy can deny the actual creation of resources, it cannot revoke permissions already granted by an RBAC role. Users with Contributor would still have the permission to create resources, and even though the policy denies the action, the user could potentially bypass or the policy might not cover all scenarios. Moreover, the principle of least privilege should be enforced at the RBAC level, not through additional policies. This approach is not a clean RBAC solution.
Distractor review
Assign the Reader role to the developers and use Azure Policy to automatically start, stop, and restart VMs on their behalf.
The Reader role only allows read access to resources; it does not grant any permissions to perform actions like starting, stopping, or restarting VMs. Azure Policy does not grant permissions to execute actions; it enforces rules on resource configuration. To perform actions, users need the appropriate RBAC role assignments. This approach would not give developers the ability to start/stop VMs.
Common exam trap
Common exam trap: authentication is not authorization
Logging in proves the user can authenticate. It does not automatically mean the user is allowed to enter privileged or configuration mode. Watch for AAA authorization, privilege level and command authorization details.
Technical deep dive
How to think about this question
This kind of question is testing the difference between identity and permission. A user may successfully log in to a router because authentication is working, but still fail to enter configuration mode because authorization is missing, misconfigured or mapped to a lower privilege level.
KKey Concepts to Remember
- Authentication checks who the user is.
- Authorization controls what the user is allowed to do after login.
- Privilege levels affect access to EXEC and configuration commands.
- AAA, TACACS+ and RADIUS can separate login success from command access.
TExam Day Tips
- Do not assume successful login means full administrative access.
- Look for words such as cannot enter configuration mode, privilege level, authorization or command access.
- Separate login problems from permission problems before choosing the answer.
Related practice questions
Related AZ-900 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
AZ-900 cloud concepts practice questions
Practise AZ-900 questions linked to AZ-900 cloud concepts.
AZ-900 Azure services practice questions
Practise AZ-900 questions linked to AZ-900 Azure services.
AZ-900 pricing and support practice questions
Practise AZ-900 questions linked to AZ-900 pricing and support.
AZ-900 security and compliance practice questions
Practise AZ-900 questions linked to AZ-900 security and compliance.
AZ-900 governance practice questions
Practise AZ-900 questions linked to AZ-900 governance.
More questions from this exam
Keep practising from the same exam bank, or move into a focused topic page if this question exposed a weak area.
Question 1
A developer is building a serverless application that requires integration with an on-premises SQL Server database for real-time data processing. The on-premises network is connected to Azure via a site-to-site VPN. Which Azure service would allow the function to securely access the on-premises database without exposing it to the public internet?
Question 2
A solutions architect is designing a storage solution for a large media company. The company needs to store video files that are accessed infrequently but must be retained for several years for compliance. Which two Azure storage options meet these requirements? (Select two.)
Question 3
A company deploys a multi-tier application using Azure virtual machines. The web tier VMs must be evenly distributed across two distinct data centers within an Azure region to avoid a single point of failure from an infrastructure outage. Which Azure construct should they use to meet this requirement?
Question 4
A company wants to enforce a set of security policies across all their Azure subscriptions. They have created several individual policy definitions. Which Azure construct should they use to group these policies together and assign them as a single package?
Question 5
A company deploys a line-of-business application on an Azure virtual machine. The IT team wants to ensure the application remains secure. According to the shared responsibility model, which of the following security tasks is the sole responsibility of the customer (the company)?
Question 6
A company develops a web API that runs on Azure App Service. The development team wants to deploy a new version of the API to a staging environment, run integration tests against it, and then gradually shift production traffic to the new version. If any issues are detected, they want to immediately roll back to the previous version without redeploying. Which Azure App Service feature should the team use to meet these requirements?
FAQ
Questions learners often ask
What does this AZ-900 question test?
Authentication checks who the user is.
What is the correct answer to this question?
The correct answer is: Create a custom RBAC role that includes only the specific actions required (e.g., Microsoft.Compute/virtualMachines/start/action, Microsoft.Compute/virtualMachines/deallocate/action) and assign it to the developers. — The principle of least privilege requires granting only the exact permissions needed for a task. Built-in roles like Virtual Machine Contributor are too broad because they include write and delete permissions for VMs, and they do not restrict access to other resource types like virtual networks. Azure RBAC does not support deny permissions within roles; instead, you define a custom role that explicitly lists only the actions you want to allow (e.g., start, stop, restart) and omits any actions for creating, deleting, or modifying VMs or networking resources. Azure Policy cannot grant RBAC permissions; it only enforces rules on resources. Therefore, creating a custom RBAC role with the specific VM actions (Microsoft.Compute/virtualMachines/start/action, Microsoft.Compute/virtualMachines/deallocate/action, Microsoft.Compute/virtualMachines/restart/action) is the correct approach.
What should I do if I get this AZ-900 question wrong?
Then try more questions from the same exam bank and focus on understanding why the wrong options are tempting.
Discussion
Sign in to join the discussion.