Module 3: Azure RBAC and Access Control

Module 3Level 1Azure Explorer

Azure RBAC and Access Control

Who can do what, where·50 minutes

Azure RBAC conceptsSecurity principalsRole definitions and assignmentsScope and inheritanceLeast-privilege principle+4 more
The situation

Who can do what, where?

The Snips Azure environment is taking shape. The Infrastructure team, Applications team and Finance team all need different levels of access. The Security team has asked you to implement a role-based access control model that gives people exactly what they need and nothing more.

This is one of the most important modules in the academy. Getting RBAC wrong is one of the most common causes of Azure security incidents.

Azure RBAC concepts

Security principal

The entity that is requesting access. This can be a user, group, service principal or managed identity.

Role definition

A collection of permissions. For example, the Virtual Machine Contributor role includes permissions to create and manage VMs but not to manage the network or storage they use.

Scope

The boundary at which the role assignment applies. Can be a management group, subscription, resource group or individual resource.

Role assignment

The combination of a security principal, a role definition and a scope. This is what actually grants access.

Inheritance

Role assignments are inherited down the hierarchy. An assignment at subscription scope applies to all resource groups and resources within it.

Scope hierarchy

Management Group— Broadest scope — inherited by all subscriptions below
└Subscription— Inherited by all resource groups and resources
└Resource Group— Inherited by all resources in the group
└Resource— Narrowest scope — applies to one resource only

Built-in roles

OwnerFull access to all resources including the ability to assign roles to others. Use sparingly.
ContributorCan create and manage all types of Azure resources but cannot grant access to others.
ReaderCan view all resources but cannot make any changes.
User Access AdministratorCan manage user access to Azure resources but cannot manage the resources themselves.
Virtual Machine ContributorCan manage virtual machines but not the virtual network or storage account they are connected to.
Storage Blob Data ReaderCan read blob data. This is a data plane role — separate from the control plane Contributor role.
Least privilege: Always assign the minimum role at the narrowest scope that allows the person to do their job. If someone needs to manage a single VM, assign Virtual Machine Contributor at the resource group level — not Contributor at the subscription level.

Interactive RBAC simulator

For each scenario, select the correct role and scope. Apply the principle of least privilege.

Jamie Wilson (Finance Analyst)

Needs to VIEW Finance Azure resources but must not alter them.

Role

Scope

Priya Shah (Application Engineer)

Needs to administer the Contractor Portal VM but must not administer the entire subscription.

Role

Scope

Azure CLI

Manage role assignments
# List all role assignments in a resource group
az role assignment list \
  --resource-group rg-contractors-prod-uks-001 \
  --output table

# Assign the Reader role to a group at resource group scope
az role assignment create \
  --assignee "<group-object-id>" \
  --role "Reader" \
  --scope "/subscriptions/<sub-id>/resourceGroups/rg-contractors-prod-uks-001"

# Assign VM Contributor to a user at resource group scope
az role assignment create \
  --assignee "<user-object-id>" \
  --role "Virtual Machine Contributor" \
  --scope "/subscriptions/<sub-id>/resourceGroups/rg-contractors-prod-uks-001"

# Remove a role assignment
az role assignment delete \
  --assignee "<user-object-id>" \
  --role "Contributor" \
  --resource-group rg-contractors-prod-uks-001

Knowledge check

Five scenario-based questions on Azure RBAC.

1.Priya Shah needs to manage the Contractor Document Portal VM but must not be able to manage any other resources in the subscription. Which role and scope combination is correct?

2.A role assignment is made at the subscription level. Which resources does it apply to?

3.Which built-in role allows a user to manage all Azure resources but not grant access to others?

4.You want to check what access a specific user has on a resource group. Where in the Azure Portal would you find this?

5.The Security team has asked you to ensure that no single person can both deploy resources and grant access to them. Which combination of roles achieves this separation?

Ready to mark this module complete?

Mark complete when you have read all sections, attempted the lab and completed the knowledge check.

AZ-104 objectives covered
  • Manage Azure identities and governance