Assigning Roles at the Right Scope
A role assignment joins a principal, a role and a scope. This lesson explains the four scope levels, inheritance and how to choose the narrowest scope.
Learning outcomes
After completing this lesson, you will be able to:
- Describe the security principals and the four scope levels of Azure RBAC.
- Explain how role assignments are inherited and where inherited assignments can be removed.
- Choose the role and scope that meet a requirement with least privilege.
Security principals and scopes
The security principal is a user, a group, a service principal (the identity of an application) or a managed identity (an identity that Azure manages for a resource such as a VM or App Service). The scope is one of four levels, from broadest to narrowest: management group, subscription, resource group and resource. A role assigned at a scope is inherited by all child scopes, so Contributor on a subscription is effective on every resource group and resource in it.
Least privilege therefore means two choices: the role with the fewest permissions that meets the need, and the narrowest scope that covers the resources involved. Assigning roles to groups rather than individual users keeps assignments manageable and within the limit of 4,000 role assignments per subscription.
From broadest to narrowest scope
Creating and removing assignments
On the scope's Access control (IAM) page, Add role assignment selects the role, the members and, for privileged roles, optional conditions that constrain which roles the assignee may grant. The same is done with az role assignment create --assignee <principal> --role Reader --scope <scope-id> or New-AzRoleAssignment. Assignments take effect within minutes, and a user may need to refresh the portal or sign in again.
An inherited assignment appears on a child scope's Role assignments tab with the scope column showing where it comes from, but it can be removed only at the scope where it was created. Assignments at the root management group are rare and powerful, because they reach every subscription in the tenant. Role assignments made directly on a resource do not move with it to another resource group or subscription, because the resource ID changes, so they must be recreated after the move.
Working with assignments
Choosing the scope
The following table maps common requirements to the scope that satisfies them with the least privilege.
| Requirement | Scope |
|---|---|
| Same access in every subscription of a business unit | Management group |
| Billing reader or security auditor for one subscription | Subscription |
| Team manages the resources of one workload | Resource group |
| Application reads one storage account or key vault | Resource (or a container within it) |
The following diagram places each role assignment for developers, auditors and an application at the scope that grants least privilege.

Choosing the narrowest scope
Choosing role and scope
Subscription Sub1 contains resource groups RG1, RG2 and RG3. The developers group must create and manage resources in RG1 and RG2 only. The auditors group must view all resources in Sub1. A web app's managed identity must read blobs in one storage account in RG3. Which assignments should you create?
Assign Contributor to the developers group at RG1 and at RG2 (two assignments); assigning it at Sub1 would also cover RG3. Assign Reader to the auditors group at Sub1, which is inherited by every resource group. Assign Storage Blob Data Reader to the managed identity at the storage account (or the container), because reading blob data needs a data role and no broader scope is required.
Where must an inherited role assignment be removed?
Show answer
At the scope where it was created, such as the parent subscription or management group; it cannot be removed at the child scope.
Exam Tips
Remember for the exam
- Assignments are inherited by every child scope.
- Remove an inherited assignment at the scope where it was created.
- Assign roles to groups, at the narrowest scope that covers the requirement.
- Managed identities are assigned roles exactly like users and groups.