Azure RBAC and Access Control
Who can do what, where·50 minutes
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
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.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
# 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-001Knowledge 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.
- Manage Azure identities and governance