Identity & RBAC

💤0
Lv 10 XP
← ☁️ Microsoft Azure · AZ-104 Administration

Identity & RBAC

Intermediate ⭐ 80 XP ⏱ 20 min #azure#az-104#rbac#entra

Manage identities in Entra ID and grant least-privilege access with Azure RBAC.

📖Theory

Identity in Azure lives in Microsoft Entra ID (formerly Azure AD): users, groups, and service principals / managed identities for apps. Access to Azure resources is granted with RBAC, built from three parts:

  • Security principal — who (user, group, service principal, managed identity)
  • Role definition — what actions are allowed (Reader, Contributor, Owner, or custom)
  • Scope — where it applies (management group → subscription → resource group → resource)

Assignments inherit downward, so granting Contributor at a resource group cascades to everything inside it. Least privilege means scoping narrowly and preferring built-in roles like Reader over Owner.

🌍Real-World Example
# Assign Reader on a resource group to a user
az role assignment create \
  --assignee alex@contoso.com \
  --role "Reader" \
  --scope /subscriptions/<sub-id>/resourceGroups/rg-prod

# Give an app (managed identity) access to a Key Vault
az role assignment create \
  --assignee <managed-identity-object-id> \
  --role "Key Vault Secrets User" \
  --scope <key-vault-resource-id>
✍️Hands-On Exercise
  1. Identify the three components of an RBAC assignment in a real scenario.
  2. Decide the least-privileged built-in role for “can read all resources, change none”.
  3. Explain how an assignment at a subscription scope affects child resource groups.
  4. Describe when to use a managed identity instead of a service principal secret.
🧾Cheat Sheet
ConceptDetail
Identity storeMicrosoft Entra ID
Principal typesUser, group, SP, managed identity
Common rolesReader, Contributor, Owner
Assignment =principal + role + scope
Scope levelsMgmt group → Sub → RG → Resource
InheritanceCascades downward
Least privilegeNarrow scope, minimal role
💬Common Interview Questions
What are the three parts of an Azure RBAC assignment?

A security principal (who), a role definition (what actions), and a scope (where). Together they grant specific permissions, inheriting to child scopes.

What's the difference between Contributor and Owner?

Both can manage resources, but only Owner can also assign roles to others. Contributor cannot grant access, which limits privilege escalation.

What is a managed identity?

An Entra ID identity automatically managed for an Azure resource, so it can authenticate to services like Key Vault without any stored credentials.

📚Official Documentation

📝 My notes on this topic

Auto-saves as you type