Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 4 of 47
❮Prev Next❯

Azure RBAC: Built-in Roles and Scopes

Module 1: Identity & Governance ⏱ 12 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    Azure role-based access control (RBAC) grants access with a role assignment: a security principal (user, group, service principal or managed identity) + a role definition (a set of allowed Actions) + a scope. Scopes are management group, subscription, resource group and resource, and assignments inherit downward. The four general built-in roles are Owner (everything, including granting access), Contributor (everything except granting access), Reader (view only) and User Access Administrator (manage access only); Role Based Access Control Administrator can assign roles with conditions. Service roles such as Virtual Machine Contributor give narrower rights. Assign in Access control (IAM) or with az role assignment create.

    Simulate it » No Azure account needed

    Exam objective: 1.2.1 Manage built-in Azure roles. 1.2.2 Assign roles at different scopes. (Skills measured as of April 17, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    Azure portal: Assign Azure roles at different scopes Add a role assignment to a group at resource group scope.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading the portal…

    Search for <strong>Resource groups</strong>. Roles can be assigned at a management group, subscription, resource group or single resource.

    👆 Click the glowing item in the portal to continue

    Read the steps as text
    1. Search for Resource groups. Roles can be assigned at a management group, subscription, resource group or single resource.
    2. Type resource groups in the search bar and pick Resource groups under Services.
    3. Open rg-app → Access control (IAM).
    4. Two assignments are inherited from higher scopes. Select + Add → Add role assignment.
    5. Pick the smallest role that does the job. Virtual Machine Contributor manages VMs but can't sign in to them or touch the VNet.
    6. Assign to a group, not to individuals. When people join or leave the team, their access follows.
    7. Select Review + assign. CLI: az role assignment create --assignee App-Ops --role "Virtual Machine Contributor" --resource-group rg-app.
    8. Privileged roles get conditions that limit which roles the person may hand out. That keeps delegated admins from creating new Owners.

    🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.

    😟 THE PROBLEM

    Everyone in IT is an Owner of the production subscription.

    😊 THE SOLUTION

    Give each team the smallest built-in role at the smallest scope.

    • Owner for everyone✓ Least-privilege built-in roles
    • Access at the wrong level✓ Pick the right scope
    • Per-person assignments✓ Assign roles to groups
    🛠️ Solved with: Azure RBAC

    Start with a question

    How does a hotel make sure cleaners can open every room on their floor, but not the safe?

    A hotel doesn’t give everyone a master key. Cleaners get a card that opens every room on floor 3. The manager’s card opens every floor. The night auditor’s card opens the office but no guest rooms. Each card is a role, and the floor or building it works on is the scope.

    Azure RBAC works the same way. You give a person or group a role (what they can do) at a scope (where), and it works there and everywhere underneath.

    Explain it like I’m 10

    The technical explanation

    Who, what, where

    A role assignment has three parts:

    1. Security principal: a user, group, service principal (an app) or managed identity.
    2. Role definition: a list of permissions written as Actions (control plane, like Microsoft.Compute/virtualMachines/start/action), NotActions (taken out), DataActions and NotDataActions (data plane, like reading blobs).
    3. Scope: one of four levels, each inheriting from the one above.
    Management group   /providers/Microsoft.Management/managementGroups/mg-contoso
      Subscription     /subscriptions/<id>
        Resource group /subscriptions/<id>/resourceGroups/rg-app
          Resource     /subscriptions/<id>/resourceGroups/rg-app/providers/Microsoft.Compute/virtualMachines/vm-app01

    Built-in roles you must know

    RoleCan doCan’t doPortal tab
    OwnerEverything, including role assignmentsBypass locks or deny assignmentsPrivileged administrator roles
    ContributorCreate, change and delete any resourceAssign roles, delete locks, manage Blueprints assignmentsPrivileged administrator roles
    ReaderView everythingChange anythingJob function roles
    User Access AdministratorManage role assignmentsCreate or change resourcesPrivileged administrator roles
    Role Based Access Control AdministratorAssign roles (optionally limited by a condition)Manage access through other routes like Azure PolicyPrivileged administrator roles
    Virtual Machine ContributorManage VMs, disks, NICsManage the VNet or storage, sign in to the VMJob function roles
    Network ContributorManage networksManage VMsJob function roles
    Storage Blob Data ReaderRead blob data (DataActions)Manage the storage accountJob function roles

    Use the smallest role at the smallest scope, and assign it to a group. When nothing fits, write a custom role in JSON with your own Actions and AssignableScopes.

    Assigning roles

    Portal: open the scope → Access control (IAM) → + Add → Add role assignment → Role tab (Job function roles or Privileged administrator roles) → Members tab (user, group, or service principal / managed identity) → Conditions (privileged roles only) → Review + assign.

    # Resource group scope
    az role assignment create --assignee app-ops@contoso.com --role "Virtual Machine Contributor" --resource-group rg-app
    
    # Management group scope: every subscription below inherits it
    az role assignment create --assignee ben@contoso.com --role Reader \
      --scope /providers/Microsoft.Management/managementGroups/mg-contoso
    
    az role definition list --name "Virtual Machine Contributor"   # read the permissions
    New-AzRoleAssignment -SignInName ben@contoso.com -RoleDefinitionName Reader -Scope "/providers/Microsoft.Management/managementGroups/mg-contoso"

    Changes usually apply within minutes, though they can take longer to reach every service. A subscription can hold up to 4,000 role assignments.

    Azure roles vs Microsoft Entra roles

    Azure roles control Azure resources. Microsoft Entra roles (Global Administrator, User Administrator, License Administrator) control the directory. A Global Administrator has no Azure resource access by default; they can elevate access (Entra ID → Properties → Access management for Azure resources) to get User Access Administrator at root scope /, and should turn it off afterwards.

    1. 1 High up

      Reader at mg-contoso: Ben can read every subscription below.

    2. 2 Low down

      Contributor on rg-app: he can also change things there.

    3. 3 Add up

      In rg-app he has Reader + Contributor. Everywhere else, Reader.

    4. 4 Limit

      He still can't grant access: Contributor excludes Microsoft.Authorization writes.

    Ben's access in rg-app
    Architect level PIM and conditions

    Privileged Identity Management (PIM), part of Entra ID P2, makes Azure and Entra roles eligible instead of permanent: people activate them for a few hours with a justification and MFA. Role assignment conditions (ABAC) narrow an assignment further, for example Storage Blob Data Reader only on blobs tagged project=alpine, or RBAC Administrator only for specific roles. Both show up on the Assignment type and Conditions tabs of Add role assignment.

    Real-world business scenario

    Insurance

    Litware Insurance (fictional)

    The problem
    Twenty-two people were Owner on the production subscription, so anyone could delete anything or hand out access, and auditors flagged it every quarter.
    What they used
    Owner cut to two platform admins (eligible through PIM). App teams got Contributor on their own resource groups through groups, the network team got Network Contributor at the subscription, the helpdesk got Reader at the management group, and team leads got RBAC Administrator with a condition that blocks privileged roles.
    Why that choice
    Each team can still do its job, but only the platform admins can change access across the subscription.
    The result
    Permanent Owner assignments went from 22 to 0, and the next audit passed without access findings.

    When to use it and when not to

    ✓ Use it when…

    • Deciding who can create, change, read or delete Azure resources.
    • Delegating a resource group to an app team (Contributor or a job-function role).
    • Giving apps and automation access through managed identities.

    ✕ Think twice when…

    • Controlling what can be deployed, such as allowed regions. Use Azure Policy.
    • Protecting a resource from deletion by everyone. Use a resource lock.
    • Managing users and licenses. Use Microsoft Entra roles.

    ↔ Alternatives to consider

    • Custom roles when no built-in role is narrow enough.
    • PIM for just-in-time privileged access.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the AZ-104 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    The App team must be able to create, modify and delete any resource in resource group RG1. The team must not be able to grant other users access to RG1. Which built-in role should you assign to the App team on RG1?

    Question 2

    Question 2 of 5

    A security team must manage role assignments for all Azure resources in a subscription. The team must not be able to create or modify resources. Which role should you assign?

    Question 3

    Question 3 of 5

    Your company has 30 subscriptions under a management group named MG1, and new subscriptions are added monthly. The auditors group must be able to view resources in all current and future subscriptions. You need to minimize administrative effort. What should you do?

    Question 4

    Question 4 of 5

    Operators must start, restart and deallocate virtual machines in RG2. They must not manage virtual networks or storage accounts. You need to follow the principle of least privilege by using a built-in role. Which role should you assign on RG2?

    Question 5

    Question 5 of 5 · Select 2

    You need to assign the Reader role to User1 for a management group named MG-Prod by using Azure CLI. Which two values must the command include? Each correct answer presents part of the solution.

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner What are the three parts of an Azure role assignment?

    Model answer

    Who, what and where. Who is the security principal, such as a user or group. What is the role definition, like Reader. Where is the scope, such as one resource group. Put them together and that person can do that set of things in that place and everything below it.

    Intermediate Contributor or Owner for an app team?

    Model answer

    Contributor on their own resource group in most cases. They can build and change everything they need, but they can't give access to anyone else or remove locks. I'd keep Owner for a few platform admins, ideally through PIM so it's only active when needed.

    Experienced developer How would you let a team lead grant access without letting them create new Owners?

    Model answer

    Assign Role Based Access Control Administrator with a condition, either limited to specific roles and principals or the option that blocks assigning Owner, User Access Administrator and RBAC Administrator. That delegates day-to-day access without handing over the keys to the subscription.

    Scenario The VM team needs to start and stop VMs in rg-app but must not change the network. Which role and scope?

    Model answer

    Virtual Machine Contributor at the rg-app resource group, assigned to the VM team's group. It manages VMs and their disks but doesn't give rights over the virtual network or let them sign in to the VMs. If even that's too much I'd write a custom role with just start, deallocate and read.

    Quick revision

    Key points

    • Role assignment = security principal + role definition + scope.
    • Scopes - management group, subscription, resource group, resource. Assignments inherit downward.
    • Owner = all + grant access. Contributor = all except grant access. Reader = view. User Access Administrator = access only.
    • Prefer job-function roles (Virtual Machine Contributor, Network Contributor) at the smallest scope, assigned to groups.
    • Azure roles are separate from Microsoft Entra roles like Global Administrator.

    Important terminology

    Security principal
    Who gets access - a user, group, service principal or managed identity.
    Role definition
    A named list of allowed Actions, NotActions, DataActions and NotDataActions, such as Contributor.
    Scope
    Where an assignment applies - a management group, subscription, resource group or single resource.
    Role assignment
    The link of a principal, a role definition and a scope. It's what actually grants access.
    User Access Administrator
    A built-in role that manages access to Azure resources but can't manage the resources themselves.
    Role Based Access Control Administrator
    A built-in role that can assign roles, usually limited by a condition on which roles and principals.
    Custom role
    A role you define in JSON when no built-in role fits, with assignable scopes you choose.

    Common mistakes

    • Giving Contributor when someone also needs to grant access. Contributor can't create role assignments.
    • Assigning roles to individuals instead of groups, which leaves access behind when people move.

    Exam tips

    • "Manage VMs but not the virtual network" = Virtual Machine Contributor.
    • "Grant access to others without managing resources" = User Access Administrator.
    • "Apply to every subscription in the company with one assignment" = assign at a management group.

    Five quick revision questions

    1. 1.Which role can manage resources but not grant access?Show

      Contributor.

    2. 2.What are the four Azure RBAC scope levels?Show

      Management group, subscription, resource group, resource.

    3. 3.Which command assigns a role?Show

      az role assignment create --assignee ... --role ... --scope ...

    4. 4.Which role manages access but not resources?Show

      User Access Administrator.

    5. 5.Do Azure role assignments inherit to child scopes?Show

      Yes. An assignment applies at its scope and every scope below it.

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: Interpret Access Assignments and Effective Access

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.