Azure Management and RBAC
The identity, scope and policy layer
Management groups, subscriptions, resource groups and Azure RBAC define how Azure organizes access and billing. Entra ID houses identities; roles grant scoped permissions; Azure Policy enforces guardrails.
What you will learn
- Structure management groups → subscriptions → resource groups
- Apply Azure RBAC roles with correct scope
- Use Azure Policy for guardrails
Tenant holds the directory; management groups group subscriptions; subscriptions group resource groups; resource groups hold resources. Entra ID identities attach RBAC role assignments at any of these scopes, and Azure Policy enforces rules across them.
What is this?
An Azure tenant (Backed by Entra ID) is the top scope. Management groups organize subscriptions into a hierarchy for policy and billing assignment. A subscription is a billing and boundary unit; resources live in resource groups (a logical container with lifecycle). Azure RBAC grants access via role assignments (who, what role, at which scope) — classic roles include Owner, Contributor, Reader. Azure Policy defines guardrails (e.g. deny public storage, tag requirements) applied at management group / subscription / RG scope.
Why do you need it?
- Scope is the lever: a role at subscription scope affects everything below unless overridden.
- Resource groups make cleanup, tagging and TLS/security auditing coherent.
- Policy + RBAC together gate 'who can do what' AND 'what may exist at all'.
- Entra ID unifies sign-in for users, service principals and managed identities.
Mental model
A company with departments, teams and desks
Azure hierarchy
The company (tenant) has departments (management groups), which own teams (subscriptions), which issue desk allocations (resource groups). Security badges (RBAC) are sized per team, and company policy (Azure Policy) applies entry-level rules to every office.
How it works
- Identities live in Entra ID: users, groups, service principals, managed identities.
- Role assignments bind a role definition to a principal at a scope (management group → subscription → RG → resource).
- Effective permissions = highest scope where assigned, minus Deny assignments, minus Policy denies.
- Managed identities give Azure resources their own identity without credentials.
- Azure Policy (built-in definitions + custom) evaluates resources continuously and can deny non-compliant creation.
- Locks guard critical resources from deletion/modification regardless of RBAC.
Azure governance stack.
Examples
Scope an RBAC assignment and check it
# Create a resource groupaz group create --name rg-apps --location eastus # Give a group Reader access at the resource-group scopeaz role assignment create --assignee "devs@contoso.com" --role Reader --scope "/subscriptions/$SUBID/resourceGroups/rg-apps" # List current assignmentsaz role assignment list --scope "/subscriptions/$SUBID/resourceGroups/rg-apps" --output tableRole assignments apply at the scope you choose; Reader at RG scope lets the Devs group view everything in that RG but nothing above it.
In production
- An enterprise uses one management group per environment (prod/dev) with a Policy denying public blob access at the prod node.
- A platform team gives each product team a resource group and grants Contributor only within it.
- A security team uses managed identities for Functions to talk to Key Vault, removing all human keys.
Best practices
- Grant the least privilege that works; prefer Reader → Contributor migration only when evidence demands.
- Assign roles to groups, not individual users.
- Apply Policy at management-group scope; review policy compliance regularly.
- Protect critical subscriptions with locks and restricted high-risk actions.
Common mistakes
- Giving everyone Owner because 'debugging permissions is annoying'.
- Creating one giant resource group mixing environments.
- Assigning roles at subscription scope when RG-level would do.
- Writing policy that denies and breaking pipelines — stage policies in a 'detect only' audit mode first.
Common issues
Can't create a resource a new pipeline needsA deny Policy or missing role at the subscription/RG scope
Review policy compliance and add the needed role at the narrowest scope.
Service deleted by mistake by a team memberNo delete lock and Contributor role allowed deletion
Apply CanNotDelete locks to critical resources and minimise deletion-capable roles.
Debugging tips
- 'Unauthorized' with a valid role usually means a Policy deny or higher-scope restriction — check policy events.
- Use the activity log (Azure Monitor) to see which operation failed and why.
- Check that a managed identity's role is attached to the right scope (ARM role propagation can lag).
- Policy 'non-compliant' doesn't mean blocked — read the effect (audit vs deny).
Interview checkpoint
Hands-on lab
- Create a resource group
- Assign a role at resource-group scope
- Verify the effective assignment
Scope an RBAC Role with the Azure CLI
25 min · beginner
Quick quiz
Which is the smallest RBAC scope that contains resources?
Azure Policy can deny the creation of non-compliant resources.