Lesson 5 of 5 Azure Identity and Access

Understanding Azure Role-Based Access Control (Azure RBAC)

This lesson explains how Azure RBAC grants access with security principals, role definitions and scopes, the fundamental built-in roles, inheritance and least privilege.

Learning outcomes

After completing this lesson, you will be able to:

  • Describe the three parts of a role assignment.
  • Distinguish the Owner, Contributor, Reader and User Access Administrator roles.
  • Explain inheritance and the principle of least privilege.

The parts of a role assignment

Azure role-based access control (Azure RBAC) is the authorization system for managing access to Azure resources. Access is granted by creating a role assignment, which has three parts.

PartWhat it isExamples
Security principal (who)The identity that receives accessA user, a group, a service principal (an application) or a managed identity
Role definition (what)A collection of permitted actionsOwner, Contributor, Reader, Virtual Machine Contributor
Scope (where)The set of resources the access applies toA management group, subscription, resource group or single resource

For example, assigning the Virtual Machine Contributor role to the Ops group at the scope of the rg-web resource group lets members of Ops manage VMs in that resource group and nowhere else. Assigning roles to groups rather than individuals makes access easier to manage as people join and leave.

The following diagram combines the three parts into an assignment and shows its reach.

The three parts of an Azure role assignment. The security principal is who receives access: a user, group, service principal or managed identity. The role definition is what they may do, such as Reader or Virtual Machine Contributor. The scope is where it applies: a management group, subscription, resource group or single resource, and access is inherited by everything beneath it.
Who, what and where make an assignment.
Sort into groups

Who, what or where?

Exam skills 2.4.5

Place each item in the part of a role assignment it fills.

Log in to try this activity Interactive activities are free with an account.

Built-in roles

Azure provides hundreds of built-in roles, and organizations can create custom roles when none fits. Four fundamental built-in roles apply to all resource types.

Owner
View resourcesYes
Create, change and delete resourcesYes
Grant access to othersYes
Contributor
View resourcesYes
Create, change and delete resourcesYes
Grant access to othersNo
Reader
View resourcesYes
Create, change and delete resourcesNo
Grant access to othersNo
User Access Administrator
View resourcesYes
Create, change and delete resourcesNo
Grant access to othersYes

Service-specific roles, such as Virtual Machine Contributor, Storage Blob Data Reader or SQL DB Contributor, grant narrower permissions for particular resource types. Azure RBAC roles control access to Azure resources; they are separate from Microsoft Entra roles, such as User Administrator, which control access to directory tasks like creating users.

Select all that apply

What the Owner role can do

Exam skills 2.4.5

Recall what the fundamental built-in roles allow.

Log in to try this activity Interactive activities are free with an account.

Inheritance, the allow model and least privilege

Role assignments are inherited down the hierarchy: a role assigned at a management group applies to its subscriptions, a role at a subscription applies to every resource group and resource in it, and a role at a resource group applies to every resource in that group. Azure RBAC is an allow model: a user's effective permissions are the sum of all of their role assignments at all scopes, so if one assignment grants read and another grants write, the user can read and write.

Azure RBAC is enforced by Azure Resource Manager on every request, whether it comes from the portal, the CLI, PowerShell or an API. Good practice follows the principle of least privilege: grant only the permissions a person needs to do their job, at the narrowest scope that works. For example, a developer who manages one application's resources should be Contributor on that application's resource group, not on the whole subscription.

Scenario questions

Effective permissions

Exam skills 2.4.5

Work out what users can do from their role assignments.

Log in to try this activity Interactive activities are free with an account.
Worked example

Assigning least privilege

An auditing team must be able to view every resource in all three of a company's subscriptions, which are in one management group, but must not be able to change anything. A separate support engineer must be able to restart and manage virtual machines in one resource group only. What role assignments meet these requirements with least privilege?

Assign the Reader role to the auditing team's group at the management group scope, so that it is inherited by all three subscriptions and gives view-only access. Assign Virtual Machine Contributor to the support engineer at the scope of the resource group, which allows managing VMs there without broader rights. Contributor on the resource group would allow changing other resource types, and any assignment at the subscription scope would be broader than needed.

Check yourself

Which built-in role can manage resources but cannot grant access to others?

Show answer

Contributor. Owner can do both, and User Access Administrator can manage access only.

Exam Tips

Remember for the exam

  • A role assignment = security principal (who) + role definition (what) + scope (where).
  • Owner manages resources and access; Contributor manages resources but not access; Reader only views.
  • Role assignments are inherited by child scopes; effective permissions are the sum of assignments.
  • Grant least privilege: the narrowest role at the narrowest scope, preferably to groups.