Skip to main content

RBAC Scope

In Azure role-based access control, scope is the boundary where a role assignment applies: management group, subscription, resource group, or single resource. Permissions are inherited downward, so assign at the narrowest scope that works.

RBAC Scope

A role assignment ties together who (a user, group, or identity), what (a role definition), and where (the scope). Assigning Contributor on a subscription grants it for everything beneath, while assigning it on one resource group limits the reach. Permissions are additive, so a user's effective access is the union of all assignments that apply to them.

How Does Scope Inheritance Work?

flowchart TD M["Management group"]:::tool M -->|inherits| S["Subscription"]:::app S -->|inherits| R["Resource group"]:::app R -->|inherits| X["Resource"]:::cloud classDef tool fill:#326CE5,color:#FFFFFF classDef app fill:#EDE9FE,color:#1E293B classDef cloud fill:#D1FAE5,color:#1E293B

How Do You Assign a Role at a Narrow Scope?

Bash
az role assignment create --assignee <service-principal-id> \
--role Contributor \
--scope /subscriptions/<sub-id>/resourceGroups/mumbai-staging-rg
# See every assignment that affects a scope
az role assignment list --all --scope /subscriptions/<sub-id> --output table

Why It Matters in Production

A payments team like PhonePe can scope its CI/CD identity to the staging resource group only, so a leaked pipeline credential cannot touch production.

Security

Subscription-level Contributor or Owner is one of the most common over-privileged setups. Scope down and use Privileged Identity Management for elevated access.

Common Mistake

Fixing "access denied" by granting a broader scope. Check effective access with Check access first, because the real fix is often a more specific role at the right scope.

Frequently Asked Questions

Why assign a role at a management group instead of a subscription?

It gives one assignment that inherits across many subscriptions, useful for central teams such as security readers. The trade-off is a larger blast radius if that identity is compromised.

Can a lower scope remove access granted above?

Not with a normal role assignment, because permissions are additive. Only deny assignments, which are mostly system-managed, can block inherited access.

How do I see who has access to a resource?

Open Access control (IAM) on the resource and use Check access or Role assignments, which include inherited assignments from parent scopes.

Found a mistake, an outdated step or a broken link?