Hour 3: Identity and Access (Entra ID, RBAC, and PIM)
- Explain the trust relationship between Azure subscriptions and Entra tenants. Decide when a single tenant is enough and when a multitenant setup is required. Know what B2B, cross-tenant access settings, and Azure Lighthouse each solve.
- Read how Azure RBAC makes a decision: security principal + role definition + scope, inherited downward through the management group chain
alz→landingzones→corp→ subscription → resource group. Tell Entra roles apart from Azure roles, and control plane from data plane. - Apply the ALZ platform team / application team split: the 5 custom roles in the ALZ library (Subscription-Owner, Application-Owners, Network-Management, Network-Subnet-Contributor, Security-Operations), and use a conditional Role Based Access Control Administrator role to delegate role-assignment rights safely.
- Write least-privilege custom roles. Know that
NotActionsis not "deny," thatAssignableScopescan hold only one management group, and that a role withDataActionscannot be assigned at management group scope. - Use PIM to change high-privilege roles such as Owner and User Access Administrator into "eligible + activate + approval + time-limited." Explain the licensing requirement (Microsoft Entra ID P2 or Microsoft Entra ID Governance) and what happens when the license expires.
- Create at least two break-glass accounts, and use Conditional Access to protect administrators. Understand how the two phases of Azure mandatory MFA affect the portal, CLI, PowerShell, and IaC tools, and why automation that uses a user account as a service account must move to workload identities.
- Design deployment identities for platform and application pipelines: workload identity federation (OIDC), user-assigned managed identities, and least-privilege identities split by environment. Use managed identities for workloads, and use Azure Lighthouse for cross-tenant operations.
1-hour timetable
| # | Time | Module | Core content | Animation / interaction | Lab (sandbox tenant) |
|---|---|---|---|---|---|
| 0 | Before class | Setup: test users, groups, and starting permissions | Elevate access, confirm the management group hierarchy, create test users and security groups | Starting-permissions self-check | 5 groups + 3 test users |
| 1 | 00–06 | Tenant design | Subscription trust in one tenant, single tenant vs multitenant, B2B and cross-tenant access settings, administrative units | Tenant topology decision tool | Check the subscription-to-tenant binding |
| 2 | 06–13 | RBAC and ALZ role split | The three parts of a role assignment, inheritance, Entra roles vs Azure roles, platform/application team split table, conditional delegation | RBAC decision simulator (evaluates down the management group tree) | Assign roles on platform / corp / subscription and verify |
| 3 | 13–21 | Custom roles and least privilege | Actions / NotActions / DataActions, wildcards, AssignableScopes restrictions, the 5 ALZ custom roles | Custom role builder (checks in real time whether an operation is allowed) | Create the Landing Zone VM Operator role |
| 4 | 21–28 | PIM just-in-time access | Eligible vs active assignment, activation settings, approval, PIM for Groups, licensing and consequences of expiry | Core animation: eligibility → activation and approval → role assignment takes effect → RBAC decision → expiry and revocation | Convert Owner to PIM eligibility and activate it once |
| 5 | 28–35 | Break-glass and Conditional Access | break-glass accounts, FIDO2/CBA, CA exclusions and monitoring, the two phases of Azure mandatory MFA | "Will this sign-in be blocked?" evaluator | 2 emergency accounts + report-only CA policy + sign-in alerts |
| 6 | 35–42 | Deployment identity: workload identity federation | Splitting platform and application pipeline identities, federated credential matching rules, the 20-credential limit, flexible federated identity credentials (preview) | Core animation: OIDC token exchange (including a failure on subject mismatch) | Configure federated credentials for id-alz-platform-plan / -apply |
| 7 | 42–50 | Managed identities and Azure Lighthouse | System-assigned vs user-assigned, getting tokens from IMDS, managed identities for DINE policies, Lighthouse authorization and limits | Two-scenario animation: IMDS token / Lighthouse projection | myapp reads Key Vault with a managed identity; Lighthouse template walkthrough |
| 8 | 50–60 | Identity review and troubleshooting | Resource Graph inventory of role assignments, access reviews, common authorization errors | Review scorecard + interactive troubleshooting tree | Export a role assignment report and find 5 types of risk |
| — | After class | Cheat sheet · Capstone lab | Deliver a complete identity baseline for a new application landing zone | Final quiz (12 questions) | Capstone lab |
Knowledge coverage matrix
| Target skill | M1 | M2 | M3 | M4 | M5 | M6 | M7 | M8 | Key commands / objects | Lab |
|---|---|---|---|---|---|---|---|---|---|---|
| Tenant boundary and cross-tenant collaboration | ✓ | · | · | · | · | · | ✓ | ✓ | az account show, cross-tenant access settings | Subscription ownership |
| RBAC inheritance and decisions | · | ✓ | ✓ | ✓ | · | ✓ | ✓ | ✓ | az role assignment list --include-inherited | Layered assignment |
| ALZ platform / application team split | · | ✓ | ✓ | ✓ | · | ✓ | · | ✓ | Application-Owners, Subscription-Owner | myapp application team |
| Least privilege and custom roles | · | · | ✓ | · | · | ✓ | ✓ | ✓ | az role definition create | VM Operator role |
| Delegating role-assignment rights (ABAC condition) | · | ✓ | ✓ | · | · | · | · | ✓ | --condition, --condition-version 2.0 | Restricted access administrator |
| PIM and just-in-time access | · | · | · | ✓ | ✓ | · | ✓ | ✓ | roleEligibilityScheduleRequests | Owner eligibility |
| Break-glass, Conditional Access, mandatory MFA | · | · | · | ✓ | ✓ | ✓ | · | ✓ | CA policies, SigninLogs | break-glass + alerts |
| Deployment identity and managed identities | · | · | · | · | ✓ | ✓ | ✓ | ✓ | az identity federated-credential create | Platform pipeline identity |
| Azure Lighthouse | ✓ | · | · | · | · | · | ✓ | · | registrationDefinitions | Template walkthrough |
What this hour does not cover (and where to learn it)
| Topic | Why it is not in this hour | Where to learn it |
|---|---|---|
| Setting up the management group hierarchy, subscription placement, policy inheritance | This hour uses the hierarchy built in hour 1 | Hour 1 |
| Azure Policy effects, remediation tasks, exemptions | This hour only covers the managed identities that DINE policies need | Hour 2 |
| Full OIDC setup steps in GitHub Actions / Azure Pipelines | Already covered step by step in the CI course. This hour only covers identity design from the ALZ perspective | GitHub hour 3, Module 2 · Azure DevOps hour 3, Module 2 |
| Domain controllers in the identity subscription, Entra Connect / Cloud Sync, hybrid identity | Belongs to the hybrid identity topic. This hour only explains where the identity subscription fits | CAF: Hybrid identity |
| Network connectivity (hub, firewall, private DNS) | Next hour | Hour 4 |
| AKS workload identity (pod-level managed identities) | Belongs to the Kubernetes topic | AKS in 8 hours |
How to use this course material
Principles · diagrams · animation · commands · lab · production case · troubleshooting · quiz · voice · video. The animations in Module 4 (PIM authorization chain) and Module 6 (OIDC token exchange) are the core of this hour.
A module counts as complete when the quiz score is 70% or higher, or when you click "Mark this module complete." Progress is saved in this browser (if local storage is blocked, it is cleared on refresh).
The "Voice" tab reads the script aloud with the browser's built-in Web Speech API (en-US). Without a English voice pack, the script can still be read or passed to a TTS tool.
platform/alz/2026.11.0 (the management group IDs and the 5 custom roles come from the alz architecture definition in that library). Azure CLI 2.76 or later is recommended (clearer error messages for mandatory MFA). Licensing: Conditional Access requires Entra ID P1 (or P2). PIM (including PIM for Groups) requires Entra ID P2 or Entra ID Governance, counted per user with eligible or time-bound assignments, per approver, and per access review participant. Lighthouse eligible authorization requires the managing tenant to have Entra ID Governance licensing that supports PIM. Without these licenses, this hour offers alternatives: security defaults, self-enforced MFA through Azure Policy, and read-only walkthroughs.Module 0 · Setup: test users, groups, and starting permissions (complete before class)
/, and you must revoke it after the labs (Module 8 and the capstone lab both check for it).- In the sandbox tenant you are a Global Administrator and have registered MFA for your own account (Azure portal and CLI write operations both require MFA; see Module 5).
- You have completed Hour 1: the management group hierarchy starts with the intermediate root
alz(display name "Azure Landing Zones"), and subscriptions have been placed under groups such asmanagement,connectivity,identity, andcorp. - On your machine: Azure CLI 2.76+ (
az version) andjq. Optionally, Azure PowerShell 14.3+ (the minimum version the docs suggest). - Licenses (optional but recommended): a trial or lab license for Entra ID P2 or ID Governance. Without a license, complete the PIM part of Module 4 and the Conditional Access part of Module 5 as a read-only walkthrough plus alternatives.
Step 1: elevate access (root scope) and confirm the management group hierarchy
The Entra Global Administrator has no access to Azure resources by default. In the Entra admin center or the Azure portal, go to Entra ID → Properties → the "Access management for Azure resources" toggle (or call the REST API below). This gives the current user User Access Administrator at root scope /.
az login --tenant <sandbox-tenant-id>\naz rest --method post --url "/providers/Microsoft.Authorization/elevateAccess?api-version=2016-07-01"\naz logout; az login --tenant <sandbox-tenant-id> # sign in again to refresh the token\naz role assignment list --role "User Access Administrator" --scope "/" -o table\naz account management-group list --query "[].{id:name, name:displayName}" -o table
Principal Role Scope ---------------------------- ------------------------- ------- admin@contosolab.onmicrosoft.com User Access Administrator / Id Name -------------- --------------------- alz Azure Landing Zones platform Platform landingzones Landing zones corp Corp online Online ...
Management group IDs follow hour 1 and your deployment (the default IDs in the ALZ library alz architecture have no prefix: alz, platform, landingzones, corp, online, local, sandbox, decommissioned, management, connectivity, identity, security). If you added a prefix when you deployed, replace the IDs in this hour's commands accordingly.
Step 2 (only if you have no results from the previous hour): minimal starting point
If you do not have an ALZ hierarchy yet, deploy it following Hour 1, "Setup". If you only want to practice identity, you can create just the 4 management groups this hour uses and place your only subscription in corp (single-subscription fallback, see the note below).
az account management-group create --name alz --display-name "Azure Landing Zones" az account management-group create --name platform --display-name "Platform" --parent alz az account management-group create --name landingzones --display-name "Landing zones" --parent alz az account management-group create --name corp --display-name "Corp" --parent landingzones SUB=$(az account show --query id -o tsv) az account management-group subscription add --name corp --subscription $SUB
platform management group (they do not inherit to the subscription under corp, which shows the boundary), and assigns the "application team roles" at the resource group rg-lz-myapp-cc. The decision logic is the same as with multiple subscriptions; only the scope is narrower. The ideal layout uses four subscriptions: sub-alz-management, sub-alz-connectivity, sub-alz-identity, and sub-lz-corp-myapp.Step 3: create test users and security groups
Following ALZ guidance, "assign roles to groups, not directly to people; each Landing Zone has its own groups." This hour uses the following objects throughout (later modules refer to them directly):
| Object | Type | Purpose (module) |
|---|---|---|
grp-alz-platform-admins | Security group (PIM eligibility) | Platform administrators; Contributor eligibility on the platform management group (2, 4) |
grp-alz-platform-readers | Security group | Day-to-day read-only access for the platform team; Reader on alz (2) |
grp-alz-netops / grp-alz-secops | Security group | Network-Management / Security-Operations custom roles (3) |
grp-lz-myapp-prod-owners | Security group | myapp application team, Application-Owners (2, 3) |
grp-lz-myapp-prod-access-admins | Security group | RBAC Administrator with conditions (2) |
grp-alz-emergency-access | Security group | Break-glass accounts, excluded from CA block-type policies (5) |
alz-admin1, app-dev1, app-sec1 | Test users | Platform administrator / application developer / application security administrator |
DOMAIN=$(az rest --url https://graph.microsoft.com/v1.0/domains --query "value[?isInitial].id" -o tsv)
for u in alz-admin1 app-dev1 app-sec1; do
az ad user create --display-name "$u" --user-principal-name "$u@$DOMAIN" \
--password "$(openssl rand -base64 18)Aa1!" --force-change-password-next-sign-in true -o none
done
for g in grp-alz-platform-admins grp-alz-platform-readers grp-alz-netops grp-alz-secops \
grp-lz-myapp-prod-owners grp-lz-myapp-prod-access-admins grp-alz-emergency-access; do
az ad group create --display-name $g --mail-nickname $g -o none
done
az ad group member add --group grp-alz-platform-admins --member-id $(az ad user show --id alz-admin1@$DOMAIN --query id -o tsv)
az ad group member add --group grp-lz-myapp-prod-owners --member-id $(az ad user show --id app-dev1@$DOMAIN --query id -o tsv)
az ad group member add --group grp-lz-myapp-prod-access-admins --member-id $(az ad user show --id app-sec1@$DOMAIN --query id -o tsv)
az ad group list --query "[?starts_with(displayName,'grp-')].displayName" -o tsv
grp-alz-emergency-access grp-alz-netops grp-alz-platform-admins grp-alz-platform-readers grp-alz-secops grp-lz-myapp-prod-access-admins grp-lz-myapp-prod-owners
The passwords are generated this way only in the sandbox. In a real environment, use a Temporary Access Pass (TAP) or an invitation flow so users register passwordless credentials themselves. The openssl in the commands needs Bash; PowerShell users can create the accounts in the portal.
Step 4: create the resource groups for the application landing zone
az group create -n rg-lz-myapp-cc -l canadacentral \ --tags env=prod owner=app-team costCenter=cc-1001 workload=myapp az group create -n rg-alz-mgmt-cc -l canadacentral \ --tags env=prod owner=platform costCenter=cc-0001 workload=alz-mgmt
With multiple subscriptions, create rg-lz-myapp-cc in sub-lz-corp-myapp and rg-alz-mgmt-cc in sub-alz-management (run az account set first).
Warm-up: answer from memory (30 seconds)
Can a Global Administrator directly delete a virtual machine in an Azure subscription?
Not by default. Entra roles and Azure RBAC are two separate authorization systems. A Global Administrator can only grant themselves User Access Administrator at root scope through "Elevate access," and then assign themselves Azure roles. This process leaves an audit record.
Does a Reader assigned on the alz management group apply to resource groups in subscriptions under corp?
Yes. Azure RBAC role assignments inherit downward through "root → management group → subscription → resource group → resource," and they are additive only (the union of what is allowed). A lower scope cannot revoke what a higher scope grants. The only way to block access is a deny assignment, or not granting the role at the higher scope.
Starting-permissions self-assessment (6 items)
Check the items your organization has already done (results are saved in this browser). Come back and check again after you finish this hour.
Module 1 · Entra ID tenant design: single tenant, multitenant, and B2B
- Explain how subscriptions, tenants, management groups, and billing accounts relate. A subscription trusts only one tenant, and the ALZ management group hierarchy exists in only one tenant.
- Following CAF guidance, use a primary enterprise tenant (single tenant) by default. List the scenarios that really need an extra tenant, and know that with multiple tenants, ALZ must be deployed once in each tenant.
- Distinguish what B2B collaboration, B2B direct connect, cross-tenant access settings, cross-tenant sync, multitenant organizations, administrative units, and Azure Lighthouse each solve.
What: the tenant is the identity and governance boundary
A Microsoft Entra tenant is a dedicated, trusted instance of Entra ID. It stores users, groups, app registrations, service principals, and managed identities. Every Azure subscription has a trust relationship with exactly one tenant: only identities in that tenant (and B2B guests invited into it) can be granted Azure roles on the subscription. Three facts follow that matter for ALZ:
- The management group hierarchy belongs to the tenant: each tenant has one root management group (its ID equals the tenant ID), and the ALZ intermediate root
alzhangs under it. A subscription from another tenant cannot be placed in this tree. - Azure Policy and RBAC assignments are also inside the tenant: policy assignments, role definitions (including custom roles), and role assignments can only apply to management groups, subscriptions, and resources in their own tenant.
- Licenses are counted per tenant: Entra ID P1 / P2, ID Governance, and Microsoft 365 licenses do not apply across tenants. Each extra tenant means another set of PIM, Conditional Access, emergency accounts, and monitoring.
The CAF multitenant docs state the conclusion plainly: ALZ is deployed in a single Entra tenant. If you have multiple tenants to govern, you must deploy a separate ALZ in each one.
Why: why single tenant is the default
- Native integration: the Entra integration of services such as Azure Storage, Azure SQL, Azure Files, and Azure Virtual Desktop usually supports only "home tenant" identities. Support for B2B guests is limited and often arrives later than GA. Keeping subscriptions in the same tenant as your users imposes the fewest limits on workload teams.
- Operational burden: each tenant needs its own JML (joiner, mover, leaver) process, auditing, Conditional Access, PIM, alerts, and licenses.
- Collaboration experience: Microsoft 365 collaboration works best within one tenant. Cross-tenant collaboration needs extra setup, such as B2B and cross-tenant access settings.
- Migration cost: moving a subscription to another tenant takes substantial work before and after (role assignments, managed identities, and Key Vault access policies are all affected). CAF even recommends that, rather than migrating, you rebuild workloads in a new subscription in the target tenant.
How: when an extra tenant is really needed
| Scenario | Approach | Notes |
|---|---|---|
| Acquisition: the acquired company already has a tenant and Microsoft 365, and may be sold again later | Keep a separate tenant and deploy its own ALZ in each tenant; simplify management with B2B, cross-tenant sync, and Lighthouse | The CAF examples Fabrikam and Tailwind are this case |
| Testing Entra ID / Microsoft 365 configuration itself (Conditional Access, authentication methods, sync rules) | A separate identity test tenant | The CAF example stresses that this tenant only tests identity and M365; Azure resources are still tested in the main tenant (using a sandbox subscription or a canary management group hierarchy) |
| Sovereign cloud or regulation requires physically isolated identity | Separate tenant (possibly in a different Microsoft cloud) | Cross-cloud B2B settings are required |
| ISV-hosted SaaS for customers | Design following the CAF ISV guidance | Do not create a tenant per customer unless the business model requires it |
| "The development team needs isolation" | No new tenant needed: use sandbox management groups and subscriptions, and delegate Entra management with administrative units | CAF explicitly recommends sandbox subscriptions and administrative units instead of a new tenant |
Multitenant and cross-tenant: toolbox comparison
| Capability | What it solves | Where it appears in this hour |
|---|---|---|
| B2B collaboration | Adds external users (or users from another tenant you own) as guests, so they can be assigned Azure roles | Modules 1, 5 (mandatory MFA also applies to guests) |
| Cross-tenant access settings | Controls inbound and outbound B2B, and whether to trust the other tenant's MFA and device claims | Modules 1, 5 |
| Cross-tenant sync / multitenant organization | Automatically creates, updates, and deletes B2B users across your own tenants to improve collaboration | Module 1 |
| Administrative units | Within one tenant, delegates users, groups, and devices to different administrators; a "restricted management" administrative unit can also stop Global-level administrators from changing specific objects | Modules 1, 2 |
| Azure Lighthouse | Projects a subscription or resource group from another tenant into the managing tenant. The managing tenant operates it with its own accounts and built-in roles, without guest accounts | Module 7 |
| Multitenant apps | An operations tool (such as ITSM) is registered once and authorized for use in multiple tenants | Module 7 |
When: design checklist
- Are all Azure subscriptions in the primary enterprise tenant? If not, record the reason in writing (acquisition, sovereignty, regulation).
- Are the EA / MCA account owner, invoice section owner, and subscription creators in the target tenant? This way a new subscription is in the right tenant from the start, avoiding a later "change directory."
- Are there fewer than 5 Global Administrators, all going through PIM and requiring approval? Is the "Access management for Azure resources" toggle set to "No" when it is not needed?
- Is the tenant where test identity configuration happens separate from the tenant that hosts Azure workloads?
Architecture diagram: one tenant, one management group tree, many subscriptions
Comparison diagram: the "multiplication effect" of single tenant vs multitenant
| What you need one copy of for each extra tenant | Single tenant | Three tenants |
|---|---|---|
| ALZ deployment (management group tree + policies + platform subscriptions) | 1 | 3 |
| Break-glass accounts (at least 2 per tenant) | 2 | 6 |
| Conditional Access policy set and PIM configuration | 1 set | 3 sets (prone to drift) |
| Entra ID P2 / Governance licensing | Counted per user | Purchased separately in each tenant |
| Deployment identities and federated credentials | Per environment | Per environment × tenant |
| Logs and alerts (SigninLogs, AuditLogs) | 1 workspace | Cross-tenant aggregation needed (e.g. Lighthouse + Sentinel) |
Interactive: tenant topology decision tool
Check the requirements your organization faces. The decision tool gives a topology following CAF guidance and lists the extra work each choice creates. The rules come from the CAF "multitenant considerations and recommendations."
Core commands: check which tenant a subscription belongs to
| Command | Purpose | Notes |
|---|---|---|
az account show --query "{sub:id, tenant:tenantId, home:homeTenantId}" | Tenant of the current subscription | tenantId is the tenant the subscription trusts; homeTenantId is the subscription's home tenant (the two mean different things under Lighthouse projection) |
az account tenant list | Tenants the current account can access | B2B guests see multiple tenants |
az account management-group show -n alz -e -r | Expand the management group tree | -e expands children, -r recurses |
az rest --url https://graph.microsoft.com/v1.0/organization | Tenant information (display name, verified domains) | Requires directory read permission |
az rest --url "https://graph.microsoft.com/v1.0/policies/crossTenantAccessPolicy/default" | Default cross-tenant access settings | View inbound trust (MFA / device) configuration |
az rest --url https://graph.microsoft.com/v1.0/directory/administrativeUnits | List administrative units | Delegation boundary within a single tenant |
az account show --query "{subscription:name, tenant:tenantId, home:homeTenantId}" -o table
az account tenant list --query "[].{tenant:tenantId, name:displayName, domain:defaultDomain}" -o table
az account management-group show -n alz -e -r --query "children[].{id:name, children:children[].name}" -o json
Subscription Tenant Home
------------------- ------------------------------------ ------------------------------------
sub-lz-corp-myapp aaaabbbb-0000-cccc-1111-dddd2222eeee aaaabbbb-0000-cccc-1111-dddd2222eeee
Tenant Name Domain
------------------------------------ ----------- ---------------------------
aaaabbbb-0000-cccc-1111-dddd2222eeee Contoso Lab contosolab.onmicrosoft.com
[
{"id": "platform", "children": ["security","management","connectivity","identity"]},
{"id": "landingzones", "children": ["corp","online","local"]},
{"id": "sandbox", "children": null},
{"id": "decommissioned", "children": null}
]
How to verify: all ALZ subscriptions should have the same tenantId; a second tenant ID means some subscription is not in this tree. Common mistake: treating homeTenantId as "the tenant I signed in to." It describes the subscription itself. Production use: assert the tenantId of a new subscription in the subscription vending process.
Lab 1: inventory the tenant boundary (about 5 minutes)
az account list --all --query "[].{name:name, tenant:tenantId, state:state}" -o table
If your account is a B2B guest of another tenant, different tenantId values appear here. Those subscriptions will not appear in your alz management group tree.
for s in $(az account list --query "[?tenantId=='$(az account show --query tenantId -o tsv)'].id" -o tsv); do az graph query -q "resourcecontainers | where type =~ 'microsoft.resources/subscriptions' and subscriptionId == '$s' | project name, mg=properties.managementGroupAncestorsChain[0].name" -o tsv --query "data[].[name,mg]" done
sub-lz-corp-myapp corp
Needs the resource-graph extension (running az graph for the first time prompts you to install it). The first element of managementGroupAncestorsChain is the direct parent management group.
az rest --url "https://graph.microsoft.com/v1.0/policies/crossTenantAccessPolicy/default" \
--query "{b2bIn:b2bCollaborationInbound.usersAndGroups.accessType, trust:inboundTrust}"
{ "b2bIn": "allowed", "trust": { "isMfaAccepted": false, "isCompliantDeviceAccepted": false, "isHybridAzureADJoinedDeviceAccepted": false } }
isMfaAccepted: false means guests must complete MFA again in this tenant. For other tenants you own, you can add an organizational setting to trust their MFA (the mandatory MFA from Module 5 also applies to guests). Requires directory read permissions such as Policy.Read.All.
Case 1: one tenant per environment, unmaintainable after three years
Problem: a company created one tenant each for dev / test / prod and deployed ALZ in each. Three years later, the three Conditional Access policy sets had drifted apart, an Entra app integration validated in the test tenant behaved differently in the prod tenant, and licensing costs doubled. Approach: put all new workloads in the primary enterprise tenant and separate environments using different subscriptions under corp; keep one test tenant only for testing identity configuration. Limitation: old subscriptions need to be rebuilt or migrated, and migration means recreating all role assignments and managed identities.
Case 2: keep a separate tenant after an acquisition
Problem: the acquired subsidiary has its own Microsoft 365 and Azure, and may be sold in the future. Approach: do not merge tenants; deploy one ALZ inside the subsidiary's tenant. The parent company's platform team gets read-only and limited operations access through Azure Lighthouse (Module 7), and the security team aggregates Sentinel data through Lighthouse. Configuration: in cross-tenant access settings, trust the other tenant's MFA claims to reduce duplicate MFA.
Case 3: "changing directory" on a subscription breaks applications
Problem: someone moved a subscription from a personal trial tenant to the enterprise tenant. All role assignments were deleted, the system-assigned managed identity stopped working, and Key Vault access failed. Approach: following the official "transfer subscription" checklist, first export role assignments, custom roles, managed identities, and Key Vault settings, then rebuild them after the transfer. Prevention: in EA / MCA, make sure subscription creators sit directly in the target tenant.
Common errors and fixes
The subscription '…' doesn't exist in cloud 'AzureCloud' / subscription not visible in az account list
Cause: the tenant you are signed in to is not the tenant the subscription trusts, or the account has no roles on that subscription.
az account tenant list -o table az login --tenant <subscription-tenant-id> az account list --all -o table
Fix: sign in with the correct tenant. If you are a B2B guest, confirm the invitation has been redeemed and you have a role assignment.
Cannot move a subscription into a management group: the subscription is not in this tenant
Cause: a management group tree belongs to only one tenant. A subscription from another tenant cannot be attached.
Fix: either deploy your own ALZ in the other tenant, or assess the full impact of "transfer subscription" before changing directory (rebuilding the workloads in the target tenant is recommended).
AADSTS50020: User account from identity provider does not exist in tenant
Cause: the user tried to sign in to a tenant where they are neither a member nor a guest.
Fix: send a B2B invitation or set up cross-tenant sync, or use Lighthouse to project the other tenant's resources into the user's home tenant.
After transferring the subscription: AuthorizationFailed, original role assignments all gone
Cause: changing directory deletes role assignments and custom roles on the subscription; system-assigned managed identities must be re-enabled.
az role assignment list --all --include-inherited -o json > ra-before.json # export before the transfer\naz role definition list --custom-role-only true -o json > roles-before.json
Fix: rebuild in the new tenant based on the exported files (principal IDs will differ and need to be remapped).
1. Use one command to show the current subscription name, the tenant ID it trusts, and the home tenant ID.
az account show --query "{subscription:name, tenant:tenantId, home:homeTenantId}" -o table2. Use Resource Graph to list all subscriptions and their direct parent management groups.
az graph query -q "resourcecontainers | where type =~ 'microsoft.resources/subscriptions' | project name, parent=properties.managementGroupAncestorsChain[0].name"
The security team proposes: "Create a separate tenant for production workloads, so people in the development tenant cannot reach production." How do you respond?
First confirm whether the motivation is "permission isolation" or "regulatory isolation." Permission isolation can be done within a single tenant: put production subscriptions under corp / online, and development under sandbox or a separate Landing Zone subscription; assign roles only to groups organized by Landing Zone; use PIM for high-privilege access; and use a restricted-management administrative unit on the Entra side. A new tenant doubles ALZ, PIM, CA, emergency accounts, licensing, and logging, and many services' Entra integration does not support guest identities. Only requirements that a single tenant cannot meet, such as regulation or acquisition, justify a new tenant, and then ALZ must be deployed separately in the new tenant.
Verified training videos
Official docs and further reading
- CAF: Considerations and recommendations for multitenant Azure Landing Zones
- Associate or add an Azure subscription to an Entra tenant · Transfer a subscription to another directory
- Cross-tenant access overview · Administrative units
Video storyboard (about 90 seconds)
This course material cannot generate video or MP3 directly. A storyboard and narration script are provided, and can be handed to a video tool.
Visual: a large box labeled "Tenant," with a management group tree inside and subscriptions attached to the leaves.
Narration: each subscription trusts only one Entra tenant, and the ALZ management groups, policies, and roles all live inside that tenant.
Visual: two more tenants are drawn, each with a full copy of ALZ, PIM, and break-glass accounts; the counter jumps from 1 to 3.
Narration: each extra tenant multiplies all governance work. That is why CAF recommends starting with the primary enterprise tenant.
Visual: the acquired company's tenant connects to the main tenant through dashed lines (Lighthouse, B2B, sync).
Narration: when you really need multitenancy, use Lighthouse to manage resources, and B2B plus cross-tenant sync to manage people.
Visual: the development team's request is pointed by arrows to a sandbox management group and administrative units, not to a new tenant.
Narration: to isolate teams, use subscriptions and administrative units first, not a new tenant.
Module 2 · Azure RBAC model and ALZ recommended role split
- Describe any authorization as "security principal + role definition + scope," and trace through the ARM decision order to see whether a request is allowed.
- Tell apart Entra roles (tenant-level: users, apps, Conditional Access) from Azure roles (resource-level: management groups, subscriptions, resources), and control plane from data plane permissions.
- Using CAF's example table, design role assignments for the platform team, security, networking, FinOps, and the myapp application team. Use a conditional Role Based Access Control Administrator so application teams can manage access themselves, but cannot escalate privileges.
What: the three parts of a role assignment
| Part | Meaning | Example in ALZ |
|---|---|---|
| Security principal (principal) | Users, groups, service principals, managed identities | grp-lz-myapp-prod-owners (a group, not an individual) |
| Role definition | A set of Actions / NotActions / DataActions / NotDataActions | ALZ custom role Application-Owners |
| Scope | root / → management group → subscription → resource group → resource | /subscriptions/<sub-lz-corp-myapp> |
An optional fourth part is a condition (ABAC, conditionVersion 2.0): for example, "only allow assigning Reader to groups." Assignments are inherited downward and are additive only: a lower scope cannot revoke permissions granted above. The only way to "subtract" is a deny assignment, which you cannot create directly. It can only be produced by Azure services (for example, the denySettings of Deployment Stacks, or managed applications).
How: how ARM decides a request (in the order described in the official docs)
- The user or workload gets a token from Entra to access ARM (the token contains the user's object ID and group memberships).
- The request reaches
management.azure.comwith the token. ARM reads the role assignments and deny assignments that apply to the target resource, including all parent scopes: resource group, subscription, each management group level, and root. - If a deny assignment matches, reject immediately.
- Filter the role assignments belonging to the user or to a group the user is in, and merge the effective permissions of those roles (within each role, first subtract
NotActionsfromActions, then take the union across roles). - Is the requested operation (such as
Microsoft.Compute/virtualMachines/write) in the effective permissions? If the assignment has a condition, evaluate the condition too. - If all checks pass, allow; otherwise return
AuthorizationFailed(403).
Only after this does Azure Policy evaluate the same request (hour 2). RBAC answers "are you allowed to do this?", and Policy answers "is this compliant?" Only when both pass is the resource created.
Entra roles vs Azure roles
| Microsoft Entra roles | Azure RBAC roles | |
|---|---|---|
| What they manage | Tenant-level: users, groups, app registrations, Conditional Access, licensing, Microsoft 365 | Azure resources: management groups, subscriptions, resource groups, resources |
| Typical roles | Global Administrator, Privileged Role Administrator, Conditional Access Administrator, Application Administrator, Groups Administrator | Owner, Contributor, Reader, User Access Administrator, Role Based Access Control Administrator |
| Scope | Tenant, administrative unit, individual app | Root, management group, subscription, resource group, resource |
| Overlap | A Global Administrator has no Azure resource permissions by default. They can only "elevate access" to get User Access Administrator at root scope (Module 0). A "role-assignable group" (isAssignableToRole=true) is protected: only the Global Administrator, the Privileged Role Administrator, or group owners can change its members. | |
Control plane vs data plane
Actions covers the control plane (creating a Key Vault, changing a storage account's network rules), and DataActions covers the data plane (reading secrets, reading and writing blobs). ALZ recommends using Azure RBAC for data-plane access where possible, and keeping the two separate: someone who can manage a Key Vault resource should not necessarily be able to read its secrets. Note that Contributor has no DataActions, yet it can call listKeys to get a storage account key. This is the classic route to bypassing data-plane RBAC with keys.
ALZ recommended role split (compiled from the CAF example table)
| Who | Role | Assigned to | Scope |
|---|---|---|---|
| Platform management team | Contributor (built-in) | grp-alz-platform-admins (PIM group) | platform management group |
| Day-to-day platform team | Reader (built-in) | grp-alz-platform-readers | Top-level organization management group alz |
| Security team | Security-Operations (ALZ custom) | grp-alz-secops | alz |
| Security team (Entra side) | Conditional Access Administrator (built-in Entra role, enables protected operations) | Security administrators group | Tenant |
| Networking team | Network-Management (ALZ custom) | grp-alz-netops | All subscriptions (or connectivity + each Landing Zone) |
| FinOps | Billing Reader (built-in) | FinOps group | alz |
| myapp application team | Application-Owners (ALZ custom) | grp-lz-myapp-prod-owners | sub-lz-corp-myapp |
| myapp security administrators | RBAC Administrator + condition (CAF calls it Application Access Administrator) | grp-lz-myapp-prod-access-admins | sub-lz-corp-myapp |
| Sandbox development team | Owner (built-in) | Development group | Resource groups in the sandbox subscription |
Three principles that run through the whole table (key points from the CAF original):
- Policies sit at the management group, and Landing Zone roles sit at the subscription / resource group: application teams have full autonomy, but cannot change the policy assignments that govern them.
- Each Landing Zone and each environment has its own groups: do not create one "all application admins" group assigned to several Landing Zones. Dev/test and prod also do not share groups, service principals, or managed identities.
- Assign roles to groups, not people: this reduces pressure on the limit of 5000 assignments per subscription (500 per management group), and when someone changes roles, you only update group membership.
Delegating the right to assign permissions: a conditional RBAC Administrator
Application teams often need to assign AcrPull to their own managed identities and Reader to test groups. Giving them Owner or User Access Administrator means they can also give Owner to anyone. CAF recommends assigning Role Based Access Control Administrator (which only has the right to manage role assignments), and adding a condition, for example "may only assign Reader / AcrPull / Key Vault Secrets User, and only to groups or service principals," or "may assign any role except Owner, User Access Administrator, and RBAC Administrator." The official docs warn about the second form: when new roles that can assign roles appear in the future, the condition will not automatically block them.
Microsoft.Authorization/*: it can give anyone any role, which means holding all the keys for that scope.Architecture diagram: role assignments on the ALZ management group tree
Flow diagram: authorization decision for a request
RBAC decision simulator: evaluating down the management group tree
Select a principal and an operation, then click "Step through decision." The simulator uses the role assignments from this hour's lab (data in the log below), collecting assignments layer by layer in ARM order, merging permissions, and evaluating conditions. The role definitions match the JSON in the ALZ library.
Core commands: assign, view, and delegate with conditions
| Command | Purpose | Notes |
|---|---|---|
az role assignment create --assignee-object-id ID --assignee-principal-type Group --role R --scope S | Create a role assignment | Using the object ID and principal type avoids directory lookup and replication delay |
az role assignment list --assignee X --all --include-inherited | All assignments for a principal (including inherited) | Management group assignments are not visible without --include-inherited |
az role assignment list --scope S --include-inherited | Assignments effective at a scope | Most useful when auditing a Landing Zone |
az role assignment create … --condition "…" --condition-version 2.0 | Delegation with conditions | The condition is written on the assignment, not on the role definition |
az role definition list --name "Owner" --query "[].permissions" | View a role's permissions | Compare the differences between Owner and Contributor |
az role assignment delete --ids ID | Delete an assignment | Before deleting, confirm it is not the last Owner |
LZ_SUB=$(az account show --query id -o tsv) # sub-lz-corp-myapp (the only subscription when there is just one)\ngid() { az ad group show -g "$1" --query id -o tsv; }\n# Platform read-only: top-level organization management group\naz role assignment create --assignee-object-id $(gid grp-alz-platform-readers) --assignee-principal-type Group \\\n --role Reader --scope /providers/Microsoft.Management/managementGroups/alz\n# Application team: Application-Owners (ALZ custom role, created when hour 1 deployed ALZ; confirm the name with az role definition list)\nAPPOWN=$(az role definition list --custom-role-only true --query "[?starts_with(roleName,'Application-Owners')].name | [0]" -o tsv)\naz role assignment create --assignee-object-id $(gid grp-lz-myapp-prod-owners) --assignee-principal-type Group \\\n --role $APPOWN --scope /subscriptions/$LZ_SUB\naz role assignment list --scope /subscriptions/$LZ_SUB --include-inherited \\\n --query "[].{who:principalName, role:roleDefinitionName, scope:scope}" -o table
Who Role Scope ------------------------------- ----------------------- ------------------------------------------------ grp-alz-platform-readers Reader /providers/Microsoft.Management/managementGroups/alz grp-alz-secops Security-Operations /providers/Microsoft.Management/managementGroups/alz grp-lz-myapp-prod-owners Application-Owners /subscriptions/1111… admin@contosolab.onmicrosoft.com User Access Administrator /
Conditional RBAC Administrator (application security administrator)
# Only allow assigning Reader(acdd72a7…) and AcrPull(7f951dda…) to groups or service principals\nCOND="((!(ActionMatches{'Microsoft.Authorization/roleAssignments/write'})) OR (@Request[Microsoft.Authorization/roleAssignments:RoleDefinitionId] ForAnyOfAnyValues:GuidEquals {acdd72a7-3385-48ef-bd42-f606fba81ae7, 7f951dda-4ed3-4680-a7ca-43fe172d538d} AND @Request[Microsoft.Authorization/roleAssignments:PrincipalType] ForAnyOfAnyValues:StringEqualsIgnoreCase {'Group', 'ServicePrincipal'})) AND ((!(ActionMatches{'Microsoft.Authorization/roleAssignments/delete'})) OR (@Resource[Microsoft.Authorization/roleAssignments:RoleDefinitionId] ForAnyOfAnyValues:GuidEquals {acdd72a7-3385-48ef-bd42-f606fba81ae7, 7f951dda-4ed3-4680-a7ca-43fe172d538d} AND @Resource[Microsoft.Authorization/roleAssignments:PrincipalType] ForAnyOfAnyValues:StringEqualsIgnoreCase {'Group', 'ServicePrincipal'}))"\naz role assignment create --assignee-object-id $(gid grp-lz-myapp-prod-access-admins) --assignee-principal-type Group \\\n --role "Role Based Access Control Administrator" --scope /subscriptions/$LZ_SUB \\\n --condition "$COND" --condition-version "2.0"
How to verify: sign in as app-sec1. Assigning Reader to grp-lz-myapp-prod-owners should succeed; assigning yourself Owner should fail with a message like "does not have authorization or an ABAC condition not fulfilled." Common mistake: writing the condition only for the write branch and forgetting the delete branch, so the delegate can delete the platform team's assignments. Production use: deploy this assignment consistently in the subscription vending template.
Lab 2: assign roles by the ALZ split and verify the boundaries (about 8 minutes)
--scope /subscriptions/$LZ_SUB with /subscriptions/$LZ_SUB/resourceGroups/rg-lz-myapp-cc.az login --tenant <sandbox-tenant-id> # sign in as app-dev1 (the first sign-in asks you to register MFA)\naz storage account create -n stmyapp$RANDOM -g rg-lz-myapp-cc -l canadacentral --sku Standard_LRS \\\n --tags env=prod owner=app-team costCenter=cc-1001 workload=myapp -o none && echo OK
OK
If a policy from hour 2 requires certain tags or blocks public access, you may see RequestDisallowedByPolicy. That error comes from Policy, not RBAC.
Microsoft.Network/virtualNetworks/write and Microsoft.Authorization/*/write.\naz network vnet create -g rg-lz-myapp-cc -n vnet-test --address-prefixes 10.9.0.0/16 az role assignment create --assignee app-dev1@<domain> --role Owner --scope /subscriptions/$LZ_SUB
(AuthorizationFailed) The client 'app-dev1@contosolab.onmicrosoft.com' with object id '…' does not have authorization to perform action 'Microsoft.Network/virtualNetworks/write' over scope '/subscriptions/…/resourceGroups/rg-lz-myapp-cc/providers/Microsoft.Network/virtualNetworks/vnet-test' or the scope is invalid. (AuthorizationFailed) … does not have authorization to perform action 'Microsoft.Authorization/roleAssignments/write' …
az role assignment create --assignee-object-id $(az ad group show -g grp-lz-myapp-prod-owners --query id -o tsv) \\\n --assignee-principal-type Group --role Reader --scope /subscriptions/$LZ_SUB # succeeds\naz role assignment create --assignee app-sec1@<domain> --role Owner --scope /subscriptions/$LZ_SUB # fails
{ "roleDefinitionName": "Reader", "principalType": "Group", … }
(AuthorizationFailed) The client 'app-sec1@…' … does not have authorization or an ABAC condition not fulfilled to perform action 'Microsoft.Authorization/roleAssignments/write' …az logout and sign in again. The official docs note that role assignment changes can take up to about 10 minutes to take effect.Case 1: one big "all application admins" group
Problem: to save effort, the platform team created an AllAppAdmins group and gave it Contributor on the landingzones management group. One application team member accidentally deleted another team's production database. Approach: following CAF guidance, switch to a separate group per Landing Zone and per environment, delegate assignments to the subscription, and move high privileges to PIM. Limitation: more groups to manage, and membership needs to be managed through access packages in ID Governance.
Case 2: Owner delegation leads to self-escalation of privileges
Problem: the application team had subscription Owner, added outsourced staff as Owners, and assigned User Access Administrator to its pipeline service principal. Approach: switch the application team to Application-Owners (no Microsoft.Authorization/*/write), and set up a separate conditional RBAC Administrator group that may assign only allowlisted roles to groups and service principals. Result: assignments outside the allowlist are blocked by the ABAC condition and leave a trace in the activity log.
Case 3: subscription hits the 5000 role assignment limit
Problem: automation assigned roles to each managed identity individually, and the subscription's assignment count approached 5000 (a fixed limit that cannot be raised). Approach: use Resource Graph to find assignments with the same role, same scope, and different principals, and convert them to group assignments. Delete redundant lower-level assignments. Where possible, convert them to PIM eligibility (eligible assignments do not count toward the limit). Note: permissions a managed identity gets through a group may take hours to take effect (token caching of about 24 hours), so for latency-sensitive scenarios, keep direct assignments.
Common errors and fixes
(AuthorizationFailed) The client '…' with object id '…' does not have authorization to perform action '…' over scope '…'
Cause: the operation is not in the effective permissions: there is no assignment, the assignment is at the wrong scope, or it is excluded by NotActions.
az role assignment list --assignee <upn-or-id> --all --include-inherited -o table
az role definition list --name "<role>" --query "[].permissions[].{a:actions, na:notActions}"
Fix: add the assignment at the narrowest correct scope. If it comes from Application-Owners' NotActions (such as VNet write), this is by design: contact the platform networking team.
PrincipalNotFound: Principal … does not exist in the directory …
Cause: a newly created user, service principal, or managed identity has not yet replicated to the region processing the request.
Fix: in CLI, use --assignee-object-id + --assignee-principal-type ServicePrincipal; in Bicep / ARM, set principalType; for a newly created group, wait a few minutes.
RoleAssignmentUpdateNotPermitted: Tenant ID, application ID, principal ID, and scope are not allowed to be updated.
Cause: in Bicep, the role assignment's name (GUID) was reused, but the principal has changed (for example, the managed identity was recreated).
Fix: generate a deterministic name with guid(scope, principalId, roleDefinitionId); delete the old assignment before creating the new one.
Status: 401 (Unauthorized) —— newly added role has no effect
Cause: ARM caching, up to about 10 minutes; permissions a managed identity gets through a group may take hours.
Fix: az logout; az login to refresh the token; for managed identities, assign the role directly rather than through a group.
Cannot delete the last RBAC admin assignment
Cause: deleting the last Owner on a subscription is blocked by default, to prevent the subscription from becoming "orphaned."
Fix: first confirm there is another Owner (or PIM eligibility); the Global Administrator is not subject to this restriction.
1. List all effective role assignments (including inherited) on rg-lz-myapp-cc, showing only the principal, role, and scope.
az role assignment list -g rg-lz-myapp-cc --include-inherited --query "[].{who:principalName, role:roleDefinitionName, scope:scope}" -o table2. Without a directory lookup, assign Reader to the managed identity whose object ID is $OID (subscription scope).
az role assignment create --assignee-object-id $OID --assignee-principal-type ServicePrincipal --role Reader --scope /subscriptions/$LZ_SUB
The myapp team asks for "Owner on the subscription, because we need to assign roles to our pipelines and managed identities." How do you meet the need without giving Owner?
Split into two groups. grp-lz-myapp-prod-owners gets Application-Owners (autonomy over resource management, but without Microsoft.Authorization/*/write, and unable to change VNets or public IPs). grp-lz-myapp-prod-access-admins gets Role Based Access Control Administrator with a condition: it may assign only allowlisted roles (Reader, AcrPull, Key Vault Secrets User, etc.) to groups or service principals, and both the write and delete branches must be written. When temporary Owner is needed, use PIM eligibility with approval. Pipeline identities are created and authorized by the platform team during subscription vending (Module 6).
Verified training videos
Official docs and further reading
- CAF: Identity and access management for Landing Zones (includes the role assignment example table)
- Azure RBAC overview (includes the decision process) · Delegate role assignment management with conditions
- RBAC limits troubleshooting (5000 / 500 / 5000)
Video storyboard (about 90 seconds)
Visual: three puzzle pieces, "who / role / scope," fit together into one role assignment.
Narration: every authorization can be broken into three questions: who, what they can do, and at which layer.
Visual: on the management group tree, Reader flows down from alz to the resource group.
Narration: assignments inherit downward and are additive only; a lower level cannot revoke what a higher level grants.
Visual: a policy shield on the corp management group, and the Application-Owners key on the subscription.
Narration: Policy lives at the management group, and the application team's key lives on the subscription. They get autonomy, but they cannot change the rules.
Visual: a lock hangs on the RBAC Administrator key, labeled "Reader, AcrPull only; groups only".
Narration: To delegate role assignment, use RBAC Administrator with conditions, not Owner.
Module 3 · Custom roles and least privilege
- Read the six key fields of a role definition JSON. Explain how
Actions − NotActionsandDataActions − NotDataActionsare calculated, and how far wildcards expand. - Remember the hard limits on custom roles: 5,000 per tenant.
AssignableScopescannot be the root/, cannot use wildcards, and can contain only one management group. A custom role withDataActionscannot be assigned at management group scope. - Read the 5 custom roles in the ALZ library. Write a least-privilege
Landing Zone VM Operatorrole, and reuse it under thealzmanagement group.
What: structure of a role definition
{
"Name": "Landing Zone VM Operator",
"Description": "Start, stop, restart VMs and read monitoring data in a landing zone.",
"Actions": [
"Microsoft.Compute/virtualMachines/read",
"Microsoft.Compute/virtualMachines/start/action",
"Microsoft.Compute/virtualMachines/restart/action",
"Microsoft.Compute/virtualMachines/deallocate/action",
"Microsoft.Compute/virtualMachines/instanceView/read",
"Microsoft.Network/networkInterfaces/read",
"Microsoft.Insights/metrics/read",
"Microsoft.Resources/subscriptions/resourceGroups/read",
"Microsoft.Support/*"
],
"NotActions": [],
"DataActions": [],
"NotDataActions": [],
"AssignableScopes": [ "/providers/Microsoft.Management/managementGroups/alz" ]
}
| Field | Meaning | Pitfall |
|---|---|---|
Actions | Allowed control-plane operations, in the format {provider}/{resource type}/{operation} | Wildcards automatically include future operations. Microsoft recommends listing operations explicitly wherever possible. |
NotActions | Subtracted from the Actions of this role | Not a deny: the same operation granted by another role still works |
DataActions / NotDataActions | Data-plane operations (read secrets, read and write blobs) | A custom role with DataActions cannot be assigned at management group scope. (You can put a management group in AssignableScopes, then assign the role on a subscription under it.) |
AssignableScopes | Scopes where this role can be assigned (up to 2,000) | Cannot be /; cannot use wildcards; only one management group; ARM does not validate that the management group exists |
Other limits: each operation string can contain only one wildcard; a tenant can have at most 5,000 custom roles (2,000 in Azure China, operated by 21Vianet); role names are unique within a tenant; renaming does not change the ID, so automation should use the role ID; before you delete a role, you must delete all assignments that use it (including PIM eligible assignments), or you get RoleDefinitionHasAssignments.
Why: when a custom role is worth writing
- Built-in roles grant too much dangerous permission. For example, Virtual Machine Contributor includes
Microsoft.Storage/storageAccounts/listKeys/action, which can return storage keys. - The permissions you need are spread across several built-in roles. Merging them into one custom role also reduces the number of role assignments (easing the 5,000-per-subscription limit).
- The ALZ separation of duties needs combinations like "Contributor, but cannot change networking or grant access."
On the other hand, do not copy built-in roles in large numbers just to look stricter. You have to maintain custom roles yourself, while Microsoft updates built-in roles as new features arrive. CAF guidance: use built-in roles where possible, and create custom roles only when necessary. Also review newly added built-in roles regularly to see whether any of them can replace your custom roles.
The 5 custom roles in the ALZ library (platform/alz, deployed at the intermediate root alz)
| Role | Actions | NotActions | Purpose |
|---|---|---|---|
| Subscription-Owner | * | Microsoft.Authorization/*/write, Microsoft.Network/vpnGateways/*, expressRouteCircuits/*, routeTables/write, vpnSites/* | Delegated to subscription owners: nearly full control, but cannot grant access and cannot touch hybrid connectivity or route tables |
| Application-Owners | * | Microsoft.Authorization/*/write, Microsoft.Network/publicIPAddresses/write, virtualNetworks/write, Microsoft.KeyVault/locations/deletedVaults/purge/action | Application and operations teams' "Contributor": cannot grant access, cannot create public IPs, cannot change VNets, cannot purge soft-deleted Key Vaults |
| Network-Management | */read, Microsoft.Network/*, Microsoft.Resources/deployments/*, Microsoft.Support/* | — | NetOps: manages global connectivity (VNets, UDRs, NSGs, NVAs, VPN, ExpressRoute) |
| Network-Subnet-Contributor | Microsoft.Network/*/read, Microsoft.Network/virtualNetworks/subnets/*, deployments, alert rules, and more | — | Can manage only subnets, not other network resources |
| Security-Operations | */read, */register/action, Key Vault purge, Microsoft.PolicyInsights/*, policy assignments / definitions / exemptions / set definitions, Microsoft.Security/*, and more | — | SecOps: read-only across the environment, plus security and policy management |
In the library, these roles' assignableScopes are the placeholder ${current_scope_resource_id}, which the alz provider / AVM modules replace with the intermediate root management group at deployment. After deployment, the roleName may get a suffix to keep it unique within the tenant. Run az role definition list --custom-role-only true to see the roles in your environment.
How: working with least privilege
- Start from the closest built-in role:
az role definition list --name "Virtual Machine Contributor" -o json. - List all operations for a resource provider with
az provider operation show --namespace Microsoft.Compute, and pick only what you need. - Set
AssignableScopesto thealzmanagement group (reused across the whole landing zone) or to a specific subscription. - In a sandbox, test each "can do / cannot do" with a test user, and add the tests to your pipeline (Module 8).
- Commit the role definitions to your IaC repository (the custom library for ALZ Terraform / Bicep), and review changes through PRs.
When: built-in role vs custom role vs conditions
| Requirement | Preferred |
|---|---|
| Standard duties (read-only, VM management, network management) | Built-in role |
| "Nearly full control, but cannot grant access or change networking" | ALZ custom roles (Application-Owners, etc.) |
| "Can assign roles, but only some of them, and only to groups" | RBAC Administrator + conditions (Module 2), not a custom role |
| "Can read only blobs with a certain index tag" | Built-in data role + ABAC conditions |
| Managed identity used for DINE policy remediation | Built-in roles only (CAF: remediation managed identities do not support custom roles) |
alz). ③ "Custom roles can be used with Lighthouse." Lighthouse supports only built-in roles (Module 7). ④ "Microsoft.Compute/*/read is read-only." Note that some /action operations (such as listKeys) can return secrets.Diagram: effective permissions = union of (Actions − NotActions) across each role
Valid and invalid ways to write AssignableScopes
| AssignableScopes | Result |
|---|---|
["/providers/Microsoft.Management/managementGroups/alz"] | ✓ Recommended: usable by all subscriptions under alz |
["/subscriptions/A", "/subscriptions/B"] | ✓ Usable on two subscriptions (the creator must have roleDefinitions/write on both) |
[".../managementGroups/corp", ".../managementGroups/online"] | ✗ Only one management group allowed → change it to their common parent, landingzones |
["/"] or ["/subscriptions/*"] | ✗ Cannot be root, cannot use wildcards |
Contains DataActions + [".../managementGroups/alz"] | ✓ Can be created, but can only be assigned at subscription or lower scope, not on a management group |
Custom role builder: live evaluation
Tick the permission strings to put in Actions and NotActions. The panel on the right evaluates in real time whether 8 test operations are allowed (using the same case-insensitive, wildcard-matching rules as ARM). Tick "Also holds Contributor" to see why NotActions is not a deny.
Core commands: list operations, create roles, update roles
| Command | Purpose | Notes |
|---|---|---|
az provider operation show --namespace Microsoft.Compute --query "resourceTypes[?name=='virtualMachines'].operations[].name" | List all VM operations | Pick the operation strings you need |
az role definition list --name "Virtual Machine Contributor" -o json | View built-in roles | As a starting point |
az role definition create --role-definition @role.json | Create a custom role | Requires roleDefinitions/write on all AssignableScopes |
az role definition update --role-definition @role.json | Update | The JSON must include Id (or name) |
az role definition list --custom-role-only true --query "[].{name:roleName, scopes:assignableScopes}" | List custom roles | For auditing |
az role definition delete --name "…" --scope … | Delete | Delete all assignments first (including PIM eligible assignments) |
cat > vm-operator.json <<'EOF'
{
"Name": "Landing Zone VM Operator",
"Description": "Start, stop, restart VMs and read monitoring data in a landing zone.",
"Actions": [
"Microsoft.Compute/virtualMachines/read",
"Microsoft.Compute/virtualMachines/start/action",
"Microsoft.Compute/virtualMachines/restart/action",
"Microsoft.Compute/virtualMachines/deallocate/action",
"Microsoft.Compute/virtualMachines/instanceView/read",
"Microsoft.Network/networkInterfaces/read",
"Microsoft.Insights/metrics/read",
"Microsoft.Resources/subscriptions/resourceGroups/read",
"Microsoft.Support/*"
],
"NotActions": [], "DataActions": [], "NotDataActions": [],
"AssignableScopes": ["/providers/Microsoft.Management/managementGroups/alz"]
}
EOF
az role definition create --role-definition @vm-operator.json --query "{name:roleName, id:name, scopes:assignableScopes}"
{
"id": "5d0a1f3e-…",
"name": "Landing Zone VM Operator",
"scopes": [ "/providers/Microsoft.Management/managementGroups/alz" ]
}
How to verify: az role definition list --name "Landing Zone VM Operator" should find the role in any subscription under alz. Common mistakes: when you write the JSON in a PowerShell here-string, the quotes get escaped; the creator has permission on only one subscription but lists several AssignableScopes (you get a "linked scope(s)" error). Production use: put the JSON in the ALZ custom library and deploy it through the platform pipeline.
Lab 3: Create and verify the Landing Zone VM Operator (about 8 minutes)
az role definition list --custom-role-only true \
--query "[].{name:roleName, notActions:permissions[0].notActions}" -o json | head -40
If ALZ is not deployed, this list is empty. You can download the JSON from the ALZ library and create the role manually, replacing ${current_scope_resource_id} with /providers/Microsoft.Management/managementGroups/alz.
grp-lz-myapp-prod-owners (for example, grp-lz-myapp-prod-operators), with scope rg-lz-myapp-cc.
az ad group create --display-name grp-lz-myapp-prod-operators --mail-nickname grp-lz-myapp-prod-operators -o none az role assignment create --assignee-object-id $(az ad group show -g grp-lz-myapp-prod-operators --query id -o tsv) \ --assignee-principal-type Group --role "Landing Zone VM Operator" \ --scope /subscriptions/$LZ_SUB/resourceGroups/rg-lz-myapp-cc
jq '.Name="Bad Role" | .AssignableScopes=["/providers/Microsoft.Management/managementGroups/corp","/providers/Microsoft.Management/managementGroups/online"]' vm-operator.json > bad.json az role definition create --role-definition @bad.json
(InvalidActionOrNotAction / BadRequest) … only one management group can be specified in AssignableScopes …
Error wording varies by version (the example is a paraphrase). In the portal, you will see "cannot add a second management group."
"DataActions": ["Microsoft.KeyVault/vaults/secrets/getSecret/action"] to the JSON, then try to assign it at the alz management group. The assignment should fail; assigning it on a subscription should succeed.az role assignment delete, run az role definition delete --name "Bad Role".Case 1: NotActions "cancelled out" by another role
Problem: the application team already has Application-Owners (which cannot write VNets), but they still changed the spoke's address space. Investigation showed that their group still had a legacy Contributor assignment on the subscription. Fix: use Resource Graph to find principals that hold several write roles at the same scope, and delete the legacy assignments. Enforce the hard "no VNet changes" requirement with policy (the Deny from hour 2) or with deployment stack denySettings, not only with NotActions.
Case 2: "future permissions" from wildcards
Problem: an operations custom role included Microsoft.Storage/*. A year later, storage added an operation that can export data, and the operations account gained that ability automatically. Fix: for read-only needs, use */read, and list write operations explicitly. Each quarter, compare the differences in az provider operation show.
Case 3: approaching the custom role limit
Problem: each project copied its own "Contributor." After a few years, the tenant is close to 5,000 custom roles. Fix: create roles by function rather than by project, set AssignableScopes to alz so they can be reused, and use Resource Graph to find custom roles with no assignments and delete them. (Note that PIM eligible assignments do not appear in ordinary queries.)
Common errors and fixes
… has permission to perform action 'Microsoft.Authorization/roleDefinitions/write' on scope '…'; however, it does not have permission … on the linked scope(s) …
Cause: you do not have permission to create role definitions on some AssignableScopes, or one of the scopes is invalid.
Fix: get User Access Administrator or Owner on all AssignableScopes (or on their parent management groups); remove invalid scopes.
You cannot add data action permissions when you have a management group as an assignable scope
Cause: portal limitation: a custom role with DataActions cannot be assigned at management group scope.
Fix: change AssignableScopes to a subscription; or keep one management group but assign only on subscriptions under it (the CLI / API can create it).
There are existing role assignments referencing role (code: RoleDefinitionHasAssignments)
Cause: the role is still assigned (including PIM eligible assignments).
az role assignment list --all --role "Landing Zone VM Operator" -o table
Fix: delete all assignments and PIM eligibilities, then delete the role.
Role definition limit exceeded. No more role definitions can be created (code: RoleDefinitionLimitExceeded)
Cause: the tenant already has 5,000 custom roles.
Fix: use Resource Graph to find custom roles with no assignments and delete them; merge the roles that were copied per project.
Policy remediation task failed: the managed identity has no permission (custom roles are not valid)
Cause: the remediation managed identity for DINE / Modify policies supports only built-in role definitions.
Fix: use built-in roles in the policy definition's roleDefinitionIds (hour 2, Module 7).
1. List all operation names for Microsoft.Compute/virtualMachines.
az provider operation show --namespace Microsoft.Compute --query "resourceTypes[?name=='virtualMachines'].operations[].name" -o tsv
2. List all custom roles and their AssignableScopes.
az role definition list --custom-role-only true --query "[].{name:roleName, scopes:assignableScopes}" -o jsonThe security team requires that application teams cannot read Key Vault secrets, but can manage the Key Vault resources themselves. How would you design this?
Key Vault with the RBAC permission model: the application teams' Application-Owners role has only control-plane permissions (Actions: *, no DataActions), so it cannot read secrets by default. Data-plane access is granted through the built-in Key Vault Secrets User role, assigned only to the workload's managed identity (Module 7) and scoped to a single vault. Application-Owners' NotActions already excludes deletedVaults/purge/action, which prevents purging a soft-deleted vault. If the team also holds Contributor or other roles, clean those up too, because NotActions is not a deny. If a person needs to read a secret temporarily, use PIM eligibility with approval.
Verified teaching videos
No verified video specifically on ALZ custom roles was found, so the storyboard below is provided instead.
Official docs and further reading
- Azure custom roles (including the limits list) · Role definition structure
- ALZ library: role_definitions
- Resource provider operations list
Video storyboard (about 90 seconds)
Visual: a JSON card, with four columns lighting up in turn: Actions, NotActions, DataActions, AssignableScopes.
Narration: A custom role is four lists: what it can do, what it subtracts, what it can do on the data plane, and where it can be assigned.
Visual: two roles overlap, and NotActions is filled in by the other role's Actions.
Narration: NotActions is not a deny. Multiple roles combine as a union.
Visual: AssignableScopes tries to list two management groups, and a red cross blocks it. An arrow points to the common parent, alz.
Narration: You can list only one management group, so put the role at alz. Then the whole ALZ can reuse it.
Visual: cards for the 5 roles in the ALZ library.
Narration: ALZ already provides five roles for subscription owners, application teams, networking, and security. Use them first, then add more as needed.
Module 4 · Privileged Identity Management: just-in-time access and approval
- Distinguish eligible assignments from active assignments. Understand that on activation, PIM creates a role assignment with an end time in ARM, and deletes it when it expires.
- Configure PIM settings for Azure resource roles: maximum activation duration (1–24 hours), MFA or a Conditional Access authentication context, justification, ticket number, and approvers. Know that settings are per role and per resource, and they do not inherit from a subscription to a resource group.
- Explain the licensing requirements and what happens when a license expires. Following CAF guidance, use PIM for Groups to manage the high-privilege groups of the platform and the landing zone.
What: the three object types PIM manages
| Type | Object | Typical use in ALZ |
|---|---|---|
| Microsoft Entra roles | Global Administrator, Privileged Role Administrator, Conditional Access Administrator, and so on | Fewer than 5 Global Administrators, all as eligible + approval (emergency accounts excepted, Module 5) |
| Azure resource roles | Owner, Contributor, User Access Administrator, and custom roles on management groups, subscriptions, resource groups, and resources | Platform admins: Contributor on platform; Owner on the landing zone subscription for temporary troubleshooting |
| PIM for Groups | Membership and ownership of security groups (or M365 groups) | CAF recommendation: assign Azure roles to a group, then use PIM to manage "who becomes a group member, and when" |
Eligible vs active, permanent vs time-limited
| Eligible | Active | |
|---|---|---|
| Meaning | "Can request." No permissions at all by default | The permission is in effect now |
| How you get the permission | Activate: meet MFA / authentication context requirements, provide a justification, and possibly wait for approval | Takes effect immediately (the admin can require MFA and a justification when creating it) |
| Duration | Eligibility can be permanent, or set to expire (for example, after 1 year) | Can be permanent or time-limited; an active assignment created by activation always has an end time |
| Counts toward the 5,000-assignments-per-subscription limit? | No | Yes |
| How it looks in ARM | roleEligibilitySchedules | An ordinary roleAssignments (end times are recorded in roleAssignmentSchedules) |
How: activation settings (Azure resource roles, configured per role and per resource)
- Maximum activation duration: 1–24 hours. Platform troubleshooting usually takes 2–4 hours.
- Require MFA on activation, or a stronger Conditional Access authentication context. Combined with an authentication strength, this requires phishing-resistant MFA and a compliant device. If you want re-verification on every activation, set sign-in frequency to "every time" in the CA policy for that context. Microsoft's note: anyone who can change CA policies can change activation requirements, so treat them as high privilege.
- Require justification / ticket number: the ticket number is an informational field only; it is not validated against your ticketing system.
- Require approval: select at least one approver (two recommended). Azure resource roles have no default approvers. Approvers do not need any role, and they cannot approve their own requests.
- Assignment duration: whether permanent eligibility / permanent active assignments are allowed; notifications before activation and before eligibility expires; Global Administrator and Privileged Role Administrator can renew.
- Allow minimal-permission activation (preview): a user eligible for Contributor can activate only Reader, but is still bound by the Contributor policy.
Key detail: role settings do not inherit. An approval setting on Owner at the subscription does not automatically apply to Owner on a resource group under it. The CAF pattern is to manage eligibility at the management group or subscription level.
Licensing: who needs it, and what happens when it expires
When the license (or trial) expires: active permanent assignments are unaffected; time-limited active assignments become permanent (they no longer expire automatically!); eligible assignments are deleted; the PIM UI, API, and PowerShell can no longer activate or manage anything; in-progress access reviews end, PIM settings are removed, and emails and alerts stop. In short, when the license lapses, people who need to activate lose access, while permissions that should have expired stay in place. Always monitor license renewal.
When: the CAF-recommended PIM pattern for ALZ
- Assign high-privilege Azure roles such as Owner and User Access Administrator to a group, then manage group membership with PIM for Groups. This way, Azure roles and Entra roles go through the same activation process.
- Example: an application admin normally sits in the
Application Administratorsgroup (minimal privilege). When they need Owner, they activate their membership in theApplication Ownersgroup through PIM. - Platform admins access workload landing zones through PIM with approval, which keeps duties separated.
- Run regular PIM access reviews. Govern automation that needs elevated rights (such as a privileged deployment pipeline) at the same level as people, and prevent application owners from using the pipeline to elevate their own privileges.
Sequence diagram: from eligibility to permission, and then reclaiming it
Structure diagram: the CAF-recommended "group + PIM" pattern
| Group | Azure role assignment (standing) | Group membership |
|---|---|---|
grp-alz-platform-readers | Reader @ alz | Permanent member (everyday visibility) |
grp-alz-platform-admins | Contributor @ platform | PIM for Groups eligible member, activates for 4 hours, requires MFA + justification |
grp-lz-myapp-prod-breakfix | Owner @ sub-lz-corp-myapp | PIM eligibility, activates for 2 hours, requires approval from the application owner |
Core animation: the authorization chain from PIM activation to resource operations
Adjust the switches, click "Next," and observe the object changes that actually happen in Entra and ARM at each step, and the result of the same az group delete request at different stages.
Core commands: manage PIM (Azure resource roles) with the ARM API
The Azure CLI has no dedicated PIM subcommands. PIM for Azure resource roles is handled through the ARM Microsoft.Authorization scheduling APIs (az rest). Azure PowerShell has matching cmdlets.
| API / command | Purpose |
|---|---|
PUT {scope}/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/{guid} (requestType: AdminAssign) | Create eligibility assignment |
PUT {scope}/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/{guid} (requestType: SelfActivate) | Activate eligibility |
GET {scope}/providers/Microsoft.Authorization/roleEligibilityScheduleInstances?$filter=asTarget() | What eligibilities do I have |
GET {scope}/providers/Microsoft.Authorization/roleManagementPolicyAssignments | View the PIM settings for each role at this scope |
New-AzRoleEligibilityScheduleRequest / New-AzRoleAssignmentScheduleRequest | PowerShell equivalent |
Get-AzRoleEligibilityScheduleInstance -Scope … | List eligibilities (ordinary role assignment queries cannot see them) |
SCOPE="/subscriptions/$LZ_SUB"
OWNER="$SCOPE/providers/Microsoft.Authorization/roleDefinitions/8e3af657-a8ff-443c-a75c-2fe8c4bcb635"
GID=$(az ad group show -g grp-alz-platform-admins --query id -o tsv)
# 1) Admin: make Owner eligible for grp-alz-platform-admins (1 year)
az rest --method put \
--url "$SCOPE/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/$(uuidgen)?api-version=2020-10-01" \
--body "{\"properties\":{\"principalId\":\"$GID\",\"roleDefinitionId\":\"$OWNER\",\"requestType\":\"AdminAssign\",\
\"justification\":\"ALZ break-fix eligibility\",\"scheduleInfo\":{\"startDateTime\":\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\",\
\"expiration\":{\"type\":\"AfterDuration\",\"duration\":\"P365D\"}}}}"
# 2) After alz-admin1 (a group member) signs in: activate for 2 hours
ME=$(az ad signed-in-user show --query id -o tsv)
az rest --method put \
--url "$SCOPE/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/$(uuidgen)?api-version=2020-10-01" \
--body "{\"properties\":{\"principalId\":\"$ME\",\"roleDefinitionId\":\"$OWNER\",\"requestType\":\"SelfActivate\",\
\"justification\":\"INC-1234 fix diagnostic settings\",\"scheduleInfo\":{\"startDateTime\":null,\
\"expiration\":{\"type\":\"AfterDuration\",\"duration\":\"PT2H\"}}}}" --query "properties.status"
{ "properties": { "status": "Provisioned", "requestType": "AdminAssign", … } }
"PendingApproval" # when approval is configured; without approval it is "Provisioned"
How to verify: after activation, az role assignment list --assignee $ME --scope $SCOPE shows Owner; after expiry, it disappears. Common mistake: the eligibility is granted to a group, but the activation request's principalId contains the group ID. For self-activation, use your own object ID (PIM matches the eligibility you get through the group). If you get an error, use PIM for Groups to activate group membership instead. Production use: write eligibility assignments in IaC (subscription vending template); people activate them through the portal or My Access.
# PowerShell equivalent (activation)
New-AzRoleAssignmentScheduleRequest -Name (New-Guid).Guid -Scope "/subscriptions/$LzSub" `
-PrincipalId $me -RoleDefinitionId $owner -RequestType SelfActivate `
-Justification "INC-1234" -ScheduleInfoStartDateTime (Get-Date).ToUniversalTime().ToString("o") -ExpirationDuration PT2H -ExpirationType AfterDuration
Lab 4: Change Owner to a PIM eligibility and activate it once (about 8 minutes)
az rest --url "https://graph.microsoft.com/v1.0/subscribedSkus" --query "value[].{sku:skuPartNumber, enabled:prepaidUnits.enabled}" -o table
Sku Enabled ---------------------- --------- AAD_PREMIUM_P2 100
sub-lz-corp-myapp: Entra admin center → ID Governance → Privileged Identity Management → Azure resources → select the subscription → Settings → Owner → Edit: maximum activation 2 hours, require MFA (or the authentication context), require justification, require approval (select your admin account as approver), and eligibility expires after 1 year.az role assignment list --scope /subscriptions/$LZ_SUB --role Owner -o table # eligibility is not shown here
az rest --url "/subscriptions/$LZ_SUB/providers/Microsoft.Authorization/roleEligibilityScheduleInstances?api-version=2020-10-01" \
--query "value[].{principal:properties.principalId, role:properties.expandedProperties.roleDefinition.displayName, end:properties.endDateTime}" -o tableaz logout; az login --tenant <sandbox-tenant-id> # alz-admin1 az role assignment list --assignee $(az ad signed-in-user show --query id -o tsv) --all -o table
Principal Role Scope --------------------------------- ----- ------------------------- alz-admin1@contosolab.onmicrosoft.com Owner /subscriptions/1111…
Case 1: the license trial expires and "temporary" permissions become permanent
Problem: a team turned on PIM during a P2 trial and gave external contractors 30-day time-limited Owner. When the trial expired, those time-limited active assignments became permanent, the eligibility assignments were all deleted, and platform admins could no longer activate anything. Fix: complete procurement during the trial period; monitor license status; export all eligibility and time-limited assignments before expiry. Lesson: PIM security depends on the license staying valid.
Case 2: settings do not inherit, which allows bypassing approval
Problem: Owner on a subscription requires approval, but someone made themselves Owner-eligible on a resource group. The Owner rule on that resource group was still the default (no approval). Fix: set eligibility only at the management group or subscription level; periodically scan lower-level eligibilities with Resource Graph and the PIM API; use Azure Policy or a process to restrict who can create eligibility assignments.
Case 3: PIM for Groups unifies the elevation process for Entra and Azure
Problem: administrators need to elevate both Groups Administrator in Entra and Contributor in Azure, and two separate activations are easy to miss. Fix: following CAF guidance, create a role-assignable group, assign both the Entra role and the Azure role to it, and have people activate group membership once. Limitation: after group membership is activated, the group claim in the token may not update until you sign in again.
Common errors and fixes
Activation succeeded, but the operation still fails with AuthorizationFailed
Cause: old token or ARM cache (up to about 10 minutes); or the activation was made at the wrong scope.
az logout; az login
az role assignment list --assignee <me> --all --query "[].{role:roleDefinitionName, scope:scope}" -o table
Fix: sign in again; confirm that the activated scope covers the target resource.
The role assignment request is pending approval / nobody approves it
Cause: approval is configured, but the approvers are unavailable; Azure resource roles have no default approvers.
Fix: configure at least two approvers (preferably from different teams); keep emergency access accounts for urgent cases instead of lowering the approval requirement.
RoleAssignmentRequestPolicyValidationFailed / ExpirationRule validation failed
Cause: the requested duration exceeds the maximum allowed by that role's PIM settings, or a required justification or ticket is missing.
Fix: check the rules in roleManagementPolicyAssignments, change duration to within the limit (for example, PT2H), and add a justification.
PIM menu disappears / The tenant does not have a valid license
Cause: the P2 / ID Governance license (or trial) has expired. Eligible assignments have been deleted, and time-limited active assignments have become permanent.
Fix: restore the license, then recreate the eligibilities; immediately review all assignments that "became permanent" and delete them.
Cannot delete the last Owner on a subscription (to change it to eligibility only)
Cause: default protection.
Fix: first activate your own Owner eligibility, then delete the standing Owner assignment, then let the activation expire naturally (the method Microsoft documents).
1. List all PIM eligibility instances on subscription $LZ_SUB (principal, role, expiry time).
az rest --url "/subscriptions/$LZ_SUB/providers/Microsoft.Authorization/roleEligibilityScheduleInstances?api-version=2020-10-01" --query "value[].{p:properties.principalId, role:properties.expandedProperties.roleDefinition.displayName, end:properties.endDateTime}" -o table2. Use PowerShell to list the eligibility assignments on a management group.
Get-AzRoleEligibilityScheduleInstance -Scope "/providers/Microsoft.Management/managementGroups/platform"
An audit finds that six platform team members are standing Owners on the alz management group. Design a remediation plan that does not disrupt daily operations and does not increase the risk of lockout.
① First confirm the license (P2 / ID Governance must cover these six people and the approvers). ② Create grp-alz-platform-readers (Reader at alz, standing) and grp-alz-platform-admins (Contributor at platform, PIM for Groups eligibility). Owner exists only as a PIM eligibility on alz, activated for 2 hours with phishing-resistant MFA and cross-team approval. ③ Keep two emergency access accounts (permanently active Global Administrator, which can elevate access) as a last resort. ④ After you activate your own Owner eligibility once, remove the standing Owners one by one. ⑤ Turn on alerts for PIM activation and quarterly access reviews. ⑥ The platform pipeline identity is unaffected (workload identities do not go through PIM; see Module 6).
Verified teaching videos
Official docs and further reading
- Configure PIM settings for Azure resource roles
- ID Governance licensing basics (including PIM licensing and what happens on expiry)
- PIM for Groups · Role Assignment Schedule Requests REST API
Video storyboard (about 90 seconds)
Visual: a gray key labeled "Eligible".
Narration: In PIM, you normally hold only eligibility, not permissions.
Visual: request → FIDO2 → the approver nods → a role assignment with a countdown appears in ARM.
Narration: When you activate, you verify your identity, state your justification, and wait for approval. Only then does PIM create a time-limited role assignment in ARM.
Visual: the countdown reaches zero, the role assignment disappears, and the request turns red.
Narration: It expires and is reclaimed automatically. The RBAC decision itself has not changed. What changes is how long that assignment exists.
Visual: the license icon turns gray, the eligibility key disappears, and the time-limited key becomes permanent.
Narration: Don't forget licensing. If P2 or ID Governance expires, eligibilities are deleted, and time-limited assignments become permanent.
Module 5 · Emergency access accounts and Conditional Access
- Set up and maintain at least two emergency access accounts according to the official checklist: cloud-only, on the
*.onmicrosoft.comdomain, permanently active Global Administrator, FIDO2 passkey or certificate-based authentication, excluded from blocking Conditional Access policies, alerted on every sign-in, and tested at least every 90 days. - Design Conditional Access for Azure administrators: phishing-resistant MFA (authentication strength), report-only mode first, protected actions, and the PIM authentication context.
- Explain the two phases of Azure mandatory MFA, the clients and operations it covers, the postponement options, and its impact on automation: managed identities and service principals are not affected, but automation that uses a user account as a service account will fail.
What: emergency access (break-glass) accounts
Official use cases: a federated identity provider is down; all of an admin's MFA devices are unavailable; the last Global Administrator leaves the company; a natural disaster cuts mobile networks; or all Global Administrators and Privileged Role Administrators are PIM-eligible and require approval, but there is no approver, so the tenant is effectively locked.
| Requirement (official security guardrails checklist) | Reason |
|---|---|
| At least 2 accounts | Redundancy |
Cloud-only accounts on the *.onmicrosoft.com domain, not federated, not synced | Does not depend on on-premises AD, AD FS, or other systems that may fail |
| Phishing-resistant authentication: passkeys (FIDO2, recommended) or certificate-based authentication, and different methods from the day-to-day admin accounts | Still subject to Azure mandatory MFA; avoid having one failure affect both |
| Permanently active Global Administrator in PIM (not eligibility) | Still gets in when PIM or approval fails |
| Excluded from CA policies that block or restrict sign-in (report-only policies do not need the exclusion) | Prevents a CA misconfiguration from locking everyone out |
| Credentials and devices do not expire and are not cleaned up automatically; stored in a separate, secure, fire-protected location | Must be available when needed |
| Alert on every sign-in, and do a post-incident review | They are the most valuable attack targets |
| Test at least every 90 days (and after staff changes) | Verify that sign-in still works and that alerts still fire |
| Use a dedicated secure workstation (PAW) | Prevents credentials from leaking onto untrusted devices |
A common approach is to create a security group (such as grp-alz-emergency-access), put both accounts in it, and exclude this group from every blocking CA policy. Note: Azure mandatory MFA applies to emergency accounts too, so "excluded from CA" does not mean "no MFA." They must have FIDO2 or certificate credentials.
Why: Azure mandatory MFA changes the rules for automation
| Phase | Start date | Scope | Operations that require MFA |
|---|---|---|---|
| Phase 1 | Starting October 2024, rolled out in stages (Microsoft 365 admin center from February 2025) | Azure portal, Microsoft Entra admin center, Intune admin center | Any create, read, update, or delete (CRUD) |
| Phase 2 | Rolled out in stages starting 2025-10-01 | Azure CLI, Azure PowerShell, Azure mobile app, IaC tools, REST API control plane, Azure SDKs: every request sent to management.azure.com | Create, update, delete (read operations are not required) |
- Not affected: workload identities, meaning managed identities and service principals (including service principals with federated credentials).
- Affected: all user accounts, including student accounts, emergency accounts, admins with active or eligible roles, and B2B guests (MFA can be performed by the resource tenant, or trusted from the guest's home tenant through cross-tenant access settings). Test tenants are not exempt either.
- "User account as service account": accounts that sign in with a username and password in scripts, Terraform, or scheduled tasks will fail on write operations. Microsoft recommends migrating to workload identities (managed identities or service principals). The ROPC (resource owner password credentials) flow is incompatible with MFA.
- Postponement: phase 1 can be postponed to 2025-09-30; phase 2 can be postponed to 2026-07-01 (
aka.ms/postponePhase2MFA, requires Global Administrator and first elevating access). As of this course's verification date (2026-11-18), both postponement windows have ended. Once phase 2 has started, it can be lifted temporarily only through a support request. - No opt-out. Enforced only in the public cloud; sovereign clouds such as Azure Government are not yet included. Microsoft Graph API requests are generally out of scope; only requests to
management.azure.comare in scope. - Client recommendation: Azure CLI 2.76+ and Azure PowerShell 14.3+, for clear error messages and the
--claims-challengeprompt.
How: Conditional Access baseline (ALZ administrators)
| Policy | Target | Grant control | Exclusions |
|---|---|---|---|
| CA01 Admin phishing-resistant MFA | Users with privileged Entra roles; apps: Windows Azure Service Management API and Microsoft Admin Portals | Authentication strength: phishing-resistant MFA | grp-alz-emergency-access |
| CA02 MFA for all users | All users, all resources | Require MFA | Emergency access group; workload identities are not in the "users" scope |
| CA03 Block legacy authentication | All users | Block | Emergency access group |
| CA04 PIM activation context | Authentication context c1 (referenced by PIM settings) | Phishing-resistant MFA + compliant device + sign-in frequency "every time" | — |
| Protected actions | Sensitive operations such as changing Conditional Access policies and cross-tenant access settings | The specified authentication context | — |
Roll out new policies in report-only mode first, and check the "report-only" results in the sign-in logs before you enforce them. Without a P1 license, use security defaults. You can also use the built-in Azure Policy definition for "self-enforcing" MFA (Audit first, then Deny) to assess the phase 2 impact. Conditional Access for workload identities requires the Workload Identities license.
When: deciding how to migrate automation identities
| Current state | After phase 2 | Migrate to |
|---|---|---|
| Pipeline uses a service principal + secret | Not affected by MFA, but the risk of a leaked secret remains | Workload identity federation (Module 6) |
| Managed identity in VMs / automation accounts / Functions | Not affected | Keep (Module 7) |
az login -u svc-deploy@… -p … in a script | Write operations fail (MFA required) | Managed identity, or a service principal with federated credentials |
Terraform using an individual's az login session | Interactive sign-in with MFA completed | Move production pipelines to workload identities |
Decision diagram: what happens on one sign-in or one ARM write request
Timeline: mandatory MFA
| Time | Event |
|---|---|
| From 2024-10 | Phase 1 rolled out in stages: Azure portal, Entra admin center, Intune admin center |
| From 2025-02 | Microsoft 365 admin center begins enforcement |
| 2025-09-30 | Latest date phase 1 can be postponed to |
| From 2025-10-01 | Phase 2 rolled out in stages: write operations for CLI, PowerShell, mobile apps, IaC, REST control plane, and SDKs |
| 2026-07-01 | Latest date phase 2 can be postponed to (passed) |
Evaluator: "Will this operation be blocked?"
Choose an identity, client, operation, and CA configuration. The evaluator reasons through the official rules: workload identities are outside the enforcement scope; the portal requires MFA for all operations; CLI / PowerShell / IaC / REST require it only for write operations; CA exclusions do not affect system enforcement.
Core commands: emergency accounts, CA policies, alerts
| Command / API | Purpose |
|---|---|
az ad user create --user-principal-name bg-admin01@<tenant>.onmicrosoft.com … | Create a cloud-only emergency account |
POST https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments | Permanently assign Global Administrator (template ID 62e90394-69f5-4237-9190-012177145e10) |
POST https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies | Create a CA policy (state: enabledForReportingButNotEnforced means report-only) |
GET …/identity/conditionalAccess/authenticationStrength/policies | View authentication strengths (built-in "phishing-resistant MFA") |
SigninLogs | where UserId in (…) | KQL for alerting on emergency account sign-ins |
az login --tenant … --scope "https://management.core.windows.net//.default" --claims-challenge "<token>" | MFA remediation sign-in prompt for CLI 2.76+ |
DOMAIN=$(az rest --url https://graph.microsoft.com/v1.0/domains --query "value[?isInitial].id" -o tsv) # *.onmicrosoft.com
for n in 01 02; do
az ad user create --display-name "Emergency Access $n" --user-principal-name bg-admin$n@$DOMAIN \
--password "$(openssl rand -base64 24)" -o none
BGID=$(az ad user show --id bg-admin$n@$DOMAIN --query id -o tsv)
az ad group member add --group grp-alz-emergency-access --member-id $BGID
az rest --method post --url https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments \
--body "{\"principalId\":\"$BGID\",\"roleDefinitionId\":\"62e90394-69f5-4237-9190-012177145e10\",\"directoryScopeId\":\"/\"}" -o none
done
# CA01: admin phishing-resistant MFA (report-only)
EXCL=$(az ad group show -g grp-alz-emergency-access --query id -o tsv)
cat > ca01.json <<EOF
{ "displayName": "CA01 - Admins - Phishing-resistant MFA (report-only)",
"state": "enabledForReportingButNotEnforced",
"conditions": {
"users": { "includeRoles": ["62e90394-69f5-4237-9190-012177145e10","e8611ab8-c189-46e8-94e1-60213ab1f814"],
"excludeGroups": ["$EXCL"] },
"applications": { "includeApplications": ["797f4846-ba00-4fd7-ba43-dac1f8f63013"] },
"clientAppTypes": ["all"] },
"grantControls": { "operator": "AND", "authenticationStrength": { "id": "00000000-0000-0000-0000-000000000004" } } }
EOF
az rest --method post --url https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies --body @ca01.json --query "{id:id, state:state}"
{ "id": "3f1c…", "state": "enabledForReportingButNotEnforced" }
ID notes: 62e90394-… is the role template ID for Global Administrator, and e8611ab8-… is the one for Privileged Role Administrator. 797f4846-… is Windows Azure Service Management API, and …0004 is the built-in authentication strength "Phishing-resistant MFA". Check these IDs against Graph before you submit; the official documentation is the reference for IDs. Calling the CA API requires the Policy.ReadWrite.ConditionalAccess permission. The default Azure CLI token may not include it, so you can do this in Graph Explorer or the portal instead. How to verify: the "report-only" view in the sign-in logs shows CA01's expected result. Common mistake: enabling the policy without first excluding the emergency access group.
Lab 5: two emergency accounts + report-only CA + sign-in alerts (about 10 minutes)
az rest --url https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies \
--query "value[].{name:displayName, state:state, excluded:conditions.users.excludeGroups}" -o json
Without a P1 license, skip this step and instead confirm that "security defaults" is enabled.
law-alz-mgmt-cc through diagnostic settings, then create a log alert (severity 0, threshold > 0):
SigninLogs | where UserPrincipalName startswith "bg-admin" | project TimeGenerated, UserPrincipalName, IPAddress, AppDisplayName, ResultType, AuthenticationRequirement
Case 1: a CA policy misconfiguration locks out all administrators
Problem: an admin created a policy requiring "all users to use compliant devices," turned it on directly, excluded no one, and the admin's laptop happened to be non-compliant. Fix: sign in with an emergency account (already excluded from the policy) and disable the policy. Improvement: roll out all new policies in report-only mode first; make excluding the emergency access group part of the policy template; treat changes to CA as protected actions.
Case 2: overnight jobs all fail after phase 2 starts
Problem: a script on an operations VM ran az login with the svc-ops@contoso.com username and password, then created snapshots. After phase 2 took effect, write operations failed with RequestDisallowedByPolicy … MFA is required. Fix: enable a managed identity on the VM (Module 7), assign Disk Snapshot Contributor, and change the script to az login --identity; then delete the svc-ops account and reclaim its license.
Case 3: an emergency account is used quietly
Problem: an engineer used an emergency account for day-to-day changes because it was convenient. Fix: run a post-incident review when the sign-in alert fires; rotate the credentials; write the rules for emergency account use into policy (two people present at all times, and a mandatory review afterward).
Common errors and fixes
(RequestDisallowedByPolicy) Resource was disallowed by policy. … Users must use MFA for Create/Update operations.
Cause: phase 2 mandatory MFA: the current token has no MFA claim, and the operation is a write.
az version --query '"azure-cli"' # recommended ≥ 2.76 az logout az login --tenant "<tenant-id>" --scope "https://management.core.windows.net//.default" --claims-challenge "<claims-challenge-token>"
Fix: Interactive users: complete MFA at sign-in (ideally enforced by CA at sign-in). Automation: switch to managed identities, or to service principals with federated credentials.
Due to a configuration change made by your administrator … you must enroll in multi-factor authentication.
Cause: an older CLI (≤ 2.75) prompts for the same situation, and the account has not registered an MFA method yet.
Fix: upgrade the CLI; register MFA for the account (automation accounts should be migrated to workload identities instead).
Emergency account sign-in blocked: AADSTS53003 Access has been blocked by Conditional Access policies
Cause: a blocking policy does not exclude the emergency access group.
Fix: use the second emergency account (if it is blocked too, contact Microsoft Support). After the fix, add "emergency access group is excluded" to the policy review pipeline.
ROPC / UsernamePasswordCredential throws an exception (AADSTS50076 and other errors that require MFA)
Cause: the resource owner password credential flow is incompatible with MFA; the MSAL / Azure Identity libraries in each language have already marked it as deprecated.
Fix: use ManagedIdentityCredential, WorkloadIdentityCredential, or a service principal with certificate or federated credentials; delete the environment variables AZURE_USERNAME and AZURE_PASSWORD.
1. List the name, state, and excluded groups of all CA policies.
az rest --url https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies --query "value[].{name:displayName, state:state, excl:conditions.users.excludeGroups}" -o json2. Write the KQL that queries emergency account sign-ins.
SigninLogs | where UserPrincipalName startswith "bg-admin" | project TimeGenerated, UserPrincipalName, IPAddress, ResultType
You take over a tenant. The only Global Administrator is the IT manager's personal account (federated to on-premises AD FS). All admins are PIM-eligible and require that manager's approval. The Terraform pipeline uses a user account with a password. List the risks and the order of remediation.
Risks: an AD FS outage or the manager leaving locks out the entire tenant; a single approver is a single point of failure; the pipeline's write operations fail after phase 2 mandatory MFA, and the password-based account carries a high risk of leaking. Order: ① immediately create two cloud-only emergency accounts on *.onmicrosoft.com with permanently active Global Administrator, register FIDO2, exclude them from blocking CA policies, configure sign-in alerts, and test them; ② at least two PIM approvers, from different teams; ③ change admin accounts to separate cloud-only admin accounts; ④ move the pipeline to workload identity federation (Module 6) and delete the user-type service account; ⑤ roll out the CA baseline in report-only mode before enforcing; ⑥ test the emergency accounts every 90 days.
Verified teaching videos
No verified video specifically covering the two phases of Azure mandatory MFA was found. Please refer to the official documentation.
Official docs and further reading
- Plan Azure mandatory MFA (two phases, postponement, FAQ)
- Manage emergency access administrator accounts
- Tutorial: self-enforce MFA with Azure Policy · Troubleshooting MFA in Azure CLI
Video storyboard (about 90 seconds)
Visual: two FIDO2 keys in a safe, labeled bg-admin01 and bg-admin02.
Narration: Every tenant needs at least two cloud-only emergency accounts, with permanent Global Administrator, signing in with FIDO2.
Visual: a list of CA policies, each with "Exclude: emergency access group," and a new policy showing "Report-only."
Narration: Every blocking policy excludes the emergency group. New policies go to report-only first.
Visual: a timeline with the 2024-10 portal and the 2025-10-01 CLI and IaC; a script with a password turns red while the managed identity stays green.
Narration: Azure mandatory MFA phase 2 covers write operations from the CLI, PowerShell, and IaC. Managed identities and service principals are not affected. User-type service accounts will fail.
Visual: an alert bell rings, and the calendar marks a 90-day test.
Narration: Every emergency sign-in triggers an alert, and you test every 90 days.
Module 6 · Deployment identities: workload identity federation (GitHub / Azure Pipelines)
- Explain the real token exchange: the CI platform issues an OIDC token → Entra matches the federated credential exactly on issuer + subject + audience → Entra issues an ARM access token → RBAC makes the decision.
- Following the ALZ IaC accelerator, split the platform pipeline identities into plan (Reader at the intermediate root + Storage Blob Data Contributor on the state container) and apply (Owner at the intermediate root + state container). Only a protected environment may use the apply identity.
- Create a separate deployment identity for each application landing zone and each environment. Know the hard limits of federated credentials (20 per identity, no wildcards, propagation delay, concurrent creation conflicts on UAMIs) and the scope of “flexible federated identity credentials” (preview).
What: what workload identity federation does
On the Entra app registration or on a user-assigned managed identity (UAMI), you add a “federated identity credential” (FIC). It declares that you trust tokens issued by a given external issuer, with a given subject and a given audience. When the pipeline runs:
- The CI platform issues a short-lived OIDC token (JWT) for this run. For GitHub:
iss = https://token.actions.githubusercontent.com, andsublooks likerepo:<org>/<repo>:environment:<env>or…:ref:refs/heads/mainor…:pull_request. For the issuer and subject formats of Azure DevOps service connections, see hour 3 of the ADO course. - The sign-in steps (
azure/login,AzureCLI@2, Terraform'suse_oidc) send this JWT as aclient_assertionto the Entra token endpoint. - Entra looks in the identity's FIC for a record where issuer and subject both match exactly and the audience includes
api://AzureADTokenExchange. It then validates the signature (officially, only issuers that sign with RS256 are tested). - On a match, Entra issues a token for
management.azure.com. From there, the RBAC decision from Module 2 applies.
Result: no long-lived secrets in the repository; the token is valid only for this run; and workload identities are not affected by Azure enforced MFA (Module 5).
Why: why ALZ splits identities
- Separate plan and apply: the plan on a PR can be triggered by any contributor, so it must not have write permissions. Apply runs only after merge, in an environment that has been approved.
- Separate platform and application: the platform apply identity has Owner at the intermediate root. It can change every policy and role, so it must be one of the most protected identities in the tenant. Application pipelines must never reuse it.
- Separate environments: the CAF explicitly says not to share managed identities or service principals between dev/test and production.
- Prevent self-escalation: the CAF warns that automation for workload teams should use role assignments that stop application owners from raising their own permissions through the pipeline (for example, the pipeline identity does not include
Microsoft.Authorization/*/write, or it uses only a conditional RBAC Administrator).
How: ALZ deployment identity design (the same split as the accelerator)
| Identity | Type | Role (scope) | Federated credential subject (GitHub example) |
|---|---|---|---|
id-alz-platform-plan | UAMI (rg-alz-mgmt-cc or an identity resource group) | Reader @ alz; Storage Blob Data Contributor @ state container | repo:contoso/alz-platform:pull_request, …:environment:alz-plan |
id-alz-platform-apply | UAMI | Owner @ alz; Storage Blob Data Contributor @ state container | repo:contoso/alz-platform:environment:alz-apply (the environment requires reviewers) |
id-lz-myapp-prod-deploy | UAMI (in sub-lz-corp-myapp) | Application-Owners @ sub-lz-corp-myapp (or Contributor @ rg-lz-myapp-cc) | repo:contoso/myapp:environment:prod |
id-lz-myapp-dev-deploy | UAMI (dev subscription) | Same as above, dev subscription only | repo:contoso/myapp:environment:dev |
The ALZ IaC accelerator (Terraform) bootstrap creates exactly these two UAMIs. The plan identity gets Reader at the intermediate root and Storage Blob Data Contributor on the state container. The apply identity gets Owner at the intermediate root and the same permission on the state container. (The Bicep version's What-If identity gets Reader, plus a custom role that contains only deployments/whatIf/action and deployments/validate/action.) The deployment identity for an application landing zone is usually created by the subscription vending module when the subscription is created.
Hard rules for federated credentials (official notes)
| Rule | Impact |
|---|---|
| Each application or UAMI supports up to 20 FICs | Do not create one FIC per branch or per PR. Use the environment as the subject. |
| The issuer + subject combination must be unique on the same identity. No property supports wildcards. | The subject must match the sub in the token exactly. If it is wrong, creation does not fail; the exchange fails later. |
The audience can have only one value. api://AzureADTokenExchange is recommended. | If you use a custom audience, both sides must match. |
| Propagation time after creating or changing | Using it right away can fail with AADSTS70021: No matching federated identity record found for presented assertion. Wait, and add retries. |
| Creating several FICs concurrently on the same UAMI returns 409 Conflict | In IaC, create them sequentially (ARM mode: serial / dependsOn; azurerm ≥ 3.40.0 already does this) |
| UAMIs in some regions (the docs list Malaysia South) do not support FICs yet | This course uses canadacentral, which is not affected. |
You can use Azure Policy to deny creating Microsoft.ManagedIdentity/userAssignedIdentities/federatedIdentityCredentials | The platform team can use this to allow only the vending process to create federated credentials. |
Flexible federated identity credentials (preview): on an app registration, claimsMatchingExpression (mutually exclusive with subject) allows restricted expression matching, for example matching all branches of a repository. For GitHub, the guidance requires matching both sub and the immutable repository_id / repository_owner_id. Not supported for managed identities yet. Do not use this preview feature for the platform apply identity.
When: UAMI or app registration?
| User-assigned managed identity (UAMI) | App registration + service principal | |
|---|---|---|
| Creator | Anyone with write permission on the resource group (an ARM resource). The platform pipeline or the vending process can create it. | Needs permission to create apps in Entra (can be turned off by “Users can register applications”) |
| Lifecycle | Follows the resource group; deleting the resource group deletes the identity | Independent of Azure subscriptions |
| Federated credentials | Supported (flexible FIC preview not supported) | Supported (including the flexible FIC preview) |
| Best for | ALZ platform / landing zone deployment identity (accelerator default) | Scenarios that need Graph application permissions, cross-tenant access (multi-tenant apps), and similar cases |
ref:refs/heads/main as the subject is secure enough.” Anyone who can push to main gets that identity. Bind apply to an environment that requires approval. ② “Use one identity for dev and prod, and separate them with RBAC.” The permissions of one identity are the union of all its roles, so the dev pipeline can change prod too. ③ “Once the federated credential is created, you can use it immediately.” There is a propagation delay. ④ “The platform apply identity can be shared with application teams to save setup work.” It has Owner at the intermediate root.Diagram: token exchange and ALZ identity layout
Core animation: OIDC token exchange (including the failure path)
Choose the trigger, the federated credential subject configured on the identity, and how long ago the FIC was created. Then step through the token contents and Entra's matching process.
Core commands: create deployment identities, federated credentials, and roles
| Command | Purpose |
|---|---|
az identity create -g RG -n NAME -l canadacentral | Create a UAMI (outputs clientId and principalId) |
az identity federated-credential create --identity-name NAME -g RG -n FIC --issuer … --subject … --audiences api://AzureADTokenExchange | Add a federated credential |
az identity federated-credential list --identity-name NAME -g RG -o table | List (no more than 20) |
az ad app federated-credential create --id APPID --parameters @fic.json | Federated credentials on the app registration |
az role assignment create --assignee-object-id PRINCIPALID --assignee-principal-type ServicePrincipal … | Grant roles to the identity (avoids replication lag) |
RG=rg-alz-mgmt-cc; ORG=contoso; REPO=alz-platform
ALZ_MG=/providers/Microsoft.Management/managementGroups/alz
for role in plan apply; do
az identity create -g $RG -n id-alz-platform-$role -l canadacentral \
--tags env=prod owner=platform costCenter=cc-0001 workload=alz-iac -o none
done
# Federated credentials: create them one at a time (concurrent creation on the same UAMI returns 409)
az identity federated-credential create -g $RG --identity-name id-alz-platform-plan -n gh-pr \
--issuer https://token.actions.githubusercontent.com --subject "repo:$ORG/$REPO:pull_request" \
--audiences api://AzureADTokenExchange
az identity federated-credential create -g $RG --identity-name id-alz-platform-apply -n gh-env-alz-apply \
--issuer https://token.actions.githubusercontent.com --subject "repo:$ORG/$REPO:environment:alz-apply" \
--audiences api://AzureADTokenExchange
# Roles: plan = Reader, apply = Owner (intermediate root)
pid() { az identity show -g $RG -n $1 --query principalId -o tsv; }
az role assignment create --assignee-object-id $(pid id-alz-platform-plan) --assignee-principal-type ServicePrincipal --role Reader --scope $ALZ_MG
az role assignment create --assignee-object-id $(pid id-alz-platform-apply) --assignee-principal-type ServicePrincipal --role Owner --scope $ALZ_MG
az identity federated-credential list -g $RG --identity-name id-alz-platform-apply --query "[].{name:name, subject:subject}" -o table
Name Subject ---------------- ------------------------------------------------ gh-env-alz-apply repo:contoso/alz-platform:environment:alz-apply
For the Storage Blob Data Contributor assignment on the state store, see the remote state section of the Terraform course. For permissions: id-token: write in the workflow file, the azure/login parameters, and creating the Azure DevOps service connection, see GitHub hour 3 / ADO hour 3. How to verify: run plan on a PR and confirm it succeeds; try a write operation and confirm it returns AuthorizationFailed; run apply in the alz-apply environment and confirm it succeeds. Common error: the case of the organization or repository name, or the environment name, in the subject does not match the actual value.
Lab 6: Set up deployment identities for the platform and myapp (about 8 minutes)
id-alz-platform-plan / -apply. With a single subscription, place them in rg-alz-mgmt-cc as well.az identity create -g rg-lz-myapp-cc -n id-lz-myapp-prod-deploy -l canadacentral \ --tags env=prod owner=app-team costCenter=cc-1001 workload=myapp -o none az identity federated-credential create -g rg-lz-myapp-cc --identity-name id-lz-myapp-prod-deploy -n gh-env-prod \ --issuer https://token.actions.githubusercontent.com --subject "repo:contoso/myapp:environment:prod" \ --audiences api://AzureADTokenExchange az role assignment create --assignee-object-id $(az identity show -g rg-lz-myapp-cc -n id-lz-myapp-prod-deploy --query principalId -o tsv) \ --assignee-principal-type ServicePrincipal --role $APPOWN --scope /subscriptions/$LZ_SUB
$APPOWN comes from Module 2 (the role ID of Application-Owners). With a single subscription, narrow the scope to rg-lz-myapp-cc.
alz or platform, and that the platform plan identity has no write roles.
for n in id-alz-platform-plan id-alz-platform-apply; do
az role assignment list --assignee $(az identity show -g rg-alz-mgmt-cc -n $n --query principalId -o tsv) --all \
--query "[].{id:'$n', role:roleDefinitionName, scope:scope}" -o table; donemyapp repository, create the environment prod and set required reviewers. Following the GitHub hour 3 workflow, replace client-id with the clientId of id-lz-myapp-prod-deploy. Then deliberately sign in from a job that has no environment and observe AADSTS700213.Case 1: any branch can deploy to production
Problem: the FIC subject of the production identity is repo:contoso/myapp:ref:refs/heads/main, and main has no branch protection. A developer pushed experimental code directly and deployed it to production. Fix: change the subject to environment:prod, set required reviewers and a deployment branch restriction on the environment, and turn on branch protection for main.
Case 2: the platform apply identity reused by an application pipeline
Problem: to “maintain one fewer identity,” the application team's pipeline also used id-alz-platform-apply. One mistaken operation deleted a policy assignment on corp. Fix: the application landing zone gets its own identity from the vending process. The FIC on the platform apply identity allows only the alz-apply environment of the platform repository. Use Azure Policy to deny creating FICs outside the platform identity resource group.
Case 3: intermittent AADSTS70021 in a pipeline
Problem: the vending process created the FIC and then immediately triggered the first deployment. “No matching federated identity record found” appeared now and then. Fix: wait for propagation, as the official guidance recommends, and add retries to the token request. In IaC, create the FICs on the same UAMI sequentially to avoid 409.
Common errors and fixes
AADSTS700213: No matching federated identity record found for presented assertion subject '…'
Cause: the sub in the token does not exactly match the subject of any FIC (environment name, branch, PR, repository rename, or casing).
az identity federated-credential list -g <rg> --identity-name <id> --query "[].subject" -o tsv # Print the actual sub inside the workflow (prints the claim only, never the token itself) curl -sH "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=api://AzureADTokenExchange" | jq -r .value | cut -d. -f2 | base64 -d 2>/dev/null | jq .sub
Fix: make the FIC subject match the actual sub exactly. Use an environment for apply-type tasks.
AADSTS70021: No matching federated identity record found for presented assertion.
Cause: a newly created or changed FIC has not propagated yet, or the issuer was typed wrong.
Fix: wait a few minutes and retry. Check the issuer (for GitHub it is https://token.actions.githubusercontent.com; watch for a trailing slash).
AADSTS700212: No matching federated identity record found for presented assertion audience
Cause: the aud in the token does not match the audience of the FIC.
Fix: use api://AzureADTokenExchange on both sides.
Conflict (409) when creating federated credentials / more than 20 federated credentials
Cause: concurrent creation on the same UAMI, or the count has reached the limit.
Fix: create them sequentially. Merge subjects using environments, or split them across several identities (one identity per environment is already the recommended practice).
Sign-in succeeds but AuthorizationFailed
Cause: the identity has no role at the target scope, or the role was just assigned and has not taken effect yet.
Fix: check the assignments as in Module 2. When assigning to a new identity, use --assignee-principal-type ServicePrincipal.
1. For the UAMI id-lz-myapp-dev-deploy, add a federated credential for the GitHub environment dev.
az identity federated-credential create -g rg-lz-myapp-cc --identity-name id-lz-myapp-dev-deploy -n gh-env-dev --issuer https://token.actions.githubusercontent.com --subject "repo:contoso/myapp:environment:dev" --audiences api://AzureADTokenExchange
2. List all federated credential subjects of id-alz-platform-apply.
az identity federated-credential list -g rg-alz-mgmt-cc --identity-name id-alz-platform-apply --query "[].subject" -o tsv
The platform team wants “one identity for everything”: one app registration, the secret stored in GitHub Secrets, Owner @ alz, shared by all platform and application repositories. Propose an alternative design.
Split it into a platform plan identity (Reader @ alz + state container) and a platform apply identity (Owner @ alz + state container), two UAMIs that use federated credentials. Bind plan to PRs, and bind apply to the approved alz-apply environment. Create one UAMI per application landing zone and per environment through the vending process. Each one holds only Application-Owners on its own subscription (or narrower roles) and cannot grant access. Delete the secret from the old app registration. Use Azure Policy to restrict where FICs can be created, and use access reviews to check high-privilege identities regularly. Workload identities do not go through PIM, so control them with least privilege, environment approval, and auditing.
Verified teaching videos
Official docs and further reading
- Considerations for workload identity federation (20-credential limit, propagation, concurrency)
- ALZ accelerator: permissions for the plan / apply identities
- Flexible federated identity credentials (preview)
Video storyboard (about 90 seconds)
Visual: a GitHub runner holds up a JWT with iss, sub, and aud on it.
Narration: on every run, the CI platform issues an ID card that belongs only to that run.
Visual: Entra checks the JWT against the federated credential, character by character. When the subject matches, a green light turns on.
Narration: Entra does one thing: it checks whether the issuer, subject, and audience exactly match the federated credential.
Visual: the plan identity gets only a magnifying glass (Reader). The apply identity gets the key (Owner) behind an approval gate.
Narration: ALZ separates plan from apply. A PR can only look. Only an approved environment can make changes.
Visual: separate dev and prod identities, each connected only to its own subscription.
Narration: one identity per landing zone and per environment. Never share them.
Module 7 · Managed identities and Azure Lighthouse
- Tell system-assigned and user-assigned managed identities apart. Know the three typical uses in ALZ: a workload (myapp reading Key Vault), DINE / Modify policy remediation, and deployment identities (Module 6).
- Describe how a workload gets a token from IMDS inside a VM or container, and why granting a managed identity permissions through a group can take hours to take effect.
- Explain the authorization model and limits of Azure Lighthouse: only built-in roles are supported; Owner and roles with DataActions are not; User Access Administrator is used only to assign roles to managed identities; and eligible authorizations require the Entra ID Governance license in the managing tenant.
What: two kinds of managed identity
| System-assigned | User-assigned (UAMI) | |
|---|---|---|
| Lifecycle | Tied to a resource: deleting the resource deletes the identity | A standalone Azure resource (Microsoft.ManagedIdentity/userAssignedIdentities) |
| Count | One per resource | One UAMI can attach to several resources; one resource can have several UAMIs |
| Pre-authorization | The principal exists only after the resource is created, so authorization has to come afterward | You can create the identity and authorize it first, then deploy resources (suits IaC and vending) |
| Federated credentials | Not supported | Supported (Module 6) |
| Typical ALZ use | Managed identities for policy assignments (DINE / Modify) | Deployment identities, workload identities, and scenarios that need pre-authorization |
How: how a workload gets a token
- Code (or
az login --identity, orManagedIdentityCredentialin the Azure Identity library) sends a request to the IMDS endpoint on the local machine,http://169.254.169.254/metadata/identity/oauth2/token. The request carries the headerMetadata: true, aresource(such ashttps://vault.azure.net), and the UAMI'sclient_id(required when there is more than one identity). App Service, Container Apps, and Functions use a local endpoint provided by the platform (IDENTITY_ENDPOINT). - Azure, on the resource's behalf, gets a token from Entra. The platform manages and rotates the credentials, and you cannot see them.
- The code uses the token to access Key Vault, Storage, or ARM. The target service decides using RBAC (data-plane roles).
Watch out for caching: the managed identity back end caches tokens per resource URI for about 24 hours. So after you add a managed identity to a group, or change the roles of that group, it can take hours to take effect. Official guidance is to assign roles to the managed identity directly.
The three kinds of managed identity in ALZ
| Purpose | Example | Key point |
|---|---|---|
| Workload | myapp (on Container Apps or a VM) uses id-myapp-cc to read the Redis connection string in kv-myapp-cc-<suffix> | Key Vault Secrets User @ a single vault. The platform team pre-creates the UAMI during vending (CAF: landing zone delivery should include the managed identities it needs) |
| Policy remediation | The hour 2 DINE policies (diagnostic settings, private DNS records) | Remediation needs a managed identity to make the changes. When you assign the policy in the portal, the system-assigned identity is authorized automatically. With IaC, you create the role assignments yourself. Only built-in roles can be used. Roles are assigned directly to the identity, not through a group. |
| Deployment | id-alz-platform-apply, id-lz-myapp-prod-deploy | UAMI + federated credentials (Module 6) |
What: Azure Lighthouse
Lighthouse lets users, groups, or service principals in the managing tenant work directly on subscriptions or resource groups in the customer (managed) tenant, without creating guest accounts in the customer tenant. Two kinds of resource are created in the customer tenant: Microsoft.ManagedServices/registrationDefinitions (what is authorized: who, and which built-in role) and registrationAssignments (where it applies: which subscription or resource group). In the portal under “My customers,” the managing side sees the projected resources, and ARM requests are checked in the customer tenant against these authorizations.
| Rules (official) | Description |
|---|---|
| Supports only Azure built-in roles | Custom roles and the classic administrator roles are not supported |
| Owner is not supported | Roles that include DataActions are not supported either, nor are roles with operations such as Microsoft.Authorization/*, roleAssignments/write, or locks/write |
| User Access Administrator is only for assigning roles to managed identities in the customer tenant | You must also declare which roles can be assigned (delegatedRoleDefinitionIds), which is used to deploy DINE remediation in the customer tenant |
| Authorized principals can be security groups or service principals | The group type must be “Security.” Adding or removing members does not require updating the delegation. |
| Include the Managed Services Registration Assignment Delete Role | Otherwise only users in the customer tenant can revoke the delegation |
| Eligible authorizations (just-in-time) require the managing tenant to have the Entra ID Governance license, which supports PIM | Activation duration from 30 minutes to 8 hours; up to 10 approvers; service principals are not supported; the same principal also needs a standing Reader-type authorization to be elevated in the portal |
| Watch out for “indirect data access” | Roles without DataActions can still reach data through operations such as listKeys (for example, Virtual Machine Contributor) |
When: when to use Lighthouse in ALZ
- Several tenants kept after an acquisition: the parent company's platform or security team gets read-only and limited operational access on the ALZ in each tenant. (The CAF multi-tenant guidance recommends Lighthouse to simplify cross-tenant management.)
- A managed service provider (MSP) that manages its customers' landing zones.
- Centralized security operations: view Defender for Cloud and Sentinel across tenants (these also need their own product configuration).
- Not a good fit: scenarios that need Owner or authorization management, and scenarios that need data-plane roles. Handle these inside the customer tenant (for example, the customer tenant's own PIM groups).
Diagram: getting a token with a managed identity, and the Lighthouse projection
Two-scenario animation: IMDS token / Lighthouse request check
Switch scenarios, then play step by step. In the Lighthouse scenario you can choose the requested role and see which authorizations get denied when the delegation is deployed.
Core commands: managed identities and Lighthouse
| Command | Purpose |
|---|---|
az identity create -g rg-lz-myapp-cc -n id-myapp-cc | Create a workload UAMI |
az vm identity assign -g … -n … --identities <uami-id> / az containerapp identity assign … | Attach the UAMI to a resource |
az login --identity --client-id <clientId> | Sign in to the CLI inside the resource with its managed identity (newer CLI versions also accept the older --username syntax; check az login -h for the current form) |
curl -H Metadata:true "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=…&client_id=…" | Call IMDS directly |
az deployment sub create -l canadacentral -f subscription.json -p @subscription.parameters.json | Deploy a Lighthouse delegation in the customer tenant |
az managedservices assignment list / az managedservices definition list | View delegations (customer tenant side) |
az identity create -g rg-lz-myapp-cc -n id-myapp-cc -l canadacentral \ --tags env=prod owner=app-team costCenter=cc-1001 workload=myapp -o none KV=kv-myapp-cc-$RANDOM az keyvault create -g rg-lz-myapp-cc -n $KV -l canadacentral --enable-rbac-authorization true \ --tags env=prod owner=app-team costCenter=cc-1001 workload=myapp -o none az role assignment create --assignee-object-id $(az identity show -g rg-lz-myapp-cc -n id-myapp-cc --query principalId -o tsv) \ --assignee-principal-type ServicePrincipal --role "Key Vault Secrets User" \ --scope $(az keyvault show -n $KV --query id -o tsv) # Inside the VM / container that has this UAMI attached: CID=$(az identity show -g rg-lz-myapp-cc -n id-myapp-cc --query clientId -o tsv) # look this up on the local machine, then pass it in curl -s -H Metadata:true "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://vault.azure.net&client_id=$CID" | jq -r '.expires_on, .resource'
1795003200 https://vault.azure.net
Key Vault names must be globally unique (3–24 characters), so add a random suffix. The hour 2 policies may require the Key Vault to disable public network access or enable purge protection, so add parameters to match your policies. How to verify: inside the VM with the UAMI attached, run az login --identity --client-id $CID; then az keyvault secret show should succeed. Against a vault you are not authorized for, you should get 403.
Lighthouse parameter file (excerpt)
{
"mspOfferName": { "value": "Contoso Platform Ops for Fabrikam" },
"managedByTenantId": { "value": "<contoso-tenant-id>" },
"authorizations": { "value": [
{ "principalId": "<grp-lh-fabrikam-readers>", "principalIdDisplayName": "Platform readers",
"roleDefinitionId": "acdd72a7-3385-48ef-bd42-f606fba81ae7" },
{ "principalId": "<grp-lh-fabrikam-readers>", "principalIdDisplayName": "Remove delegation",
"roleDefinitionId": "91c1777a-f3dc-4fae-b103-61d183457e46" }
]},
"eligibleAuthorizations": { "value": [
{ "principalId": "<grp-lh-fabrikam-ops>", "principalIdDisplayName": "Ops JIT",
"roleDefinitionId": "b24988ac-6180-42a0-ab88-20f7382dd24c",
"justInTimeAccessPolicy": { "multiFactorAuthProvider": "Azure", "maximumActivationDuration": "PT4H",
"managedByTenantApprovers": [ { "principalId": "<grp-lh-approvers>", "principalIdDisplayName": "Approvers" } ] } }
]}
}
acdd72a7… is Reader, b24988ac… is Contributor, and 91c1777a… is Managed Services Registration Assignment Delete Role (verify with az role definition list --name "…"). The template comes from the eligible authorizations folder of the official Azure-Lighthouse-samples.
Lab 7: myapp reads a secret with a managed identity + Lighthouse template walkthrough (about 8 minutes)
az role assignment create --assignee $(az ad signed-in-user show --query id -o tsv) --role "Key Vault Secrets Officer" --scope $(az keyvault show -n $KV --query id -o tsv) az keyvault secret set --vault-name $KV -n redis-connection --value "redis://redis-myapp:6379" -o none
Standard_B1s VM with no public IP and attach the UAMI. Then run the IMDS request through az vm run-command invoke. No SSH is needed:
az vm create -g rg-lz-myapp-cc -n vm-mitest-cc --image Ubuntu2404 --size Standard_B1s --public-ip-address "" \ --assign-identity $(az identity show -g rg-lz-myapp-cc -n id-myapp-cc --query id -o tsv) --generate-ssh-keys \ --tags env=prod owner=app-team costCenter=cc-1001 workload=myapp -o none az vm run-command invoke -g rg-lz-myapp-cc -n vm-mitest-cc --command-id RunShellScript \ --scripts "curl -s -H Metadata:true 'http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://vault.azure.net&client_id=$CID' | cut -c1-60"
B1s is billed hourly (plus the disk). Right after the lab, run az vm delete -g rg-lz-myapp-cc -n vm-mitest-cc --yes and delete the disk and NIC. The hour 4 networking course also uses test VMs with no public IP.
az deployment sub validate to check the template, and try changing Reader to Owner to see the validation error.
az deployment sub validate -l canadacentral -f subscription-managing-tenant-approvers.json -p @lh.parameters.json
Case 1: a managed identity authorized through a group “took a day to take effect”
Problem: the platform team added 20 managed identities to one group, then gave the group Key Vault Secrets User. After deployment, the app got 403 for several hours. Cause: the managed identity back end caches tokens for about 24 hours. Fix: assign roles directly to the managed identities. If the number of assignments is a concern, consolidate identities per vault (one UAMI shared by one application).
Case 2: DINE policy remediation failed
Problem: the DINE policy that deploys diagnostic settings was assigned with IaC, and the remediation task kept failing. Cause: IaC created only the system-assigned identity of the policy assignment, not the built-in role assignments it needs (the portal does this automatically; IaC does not). Fix: create the role assignments from the roleDefinitionIds in the policy definition, with a scope that covers the remediation targets (hour 2). The ALZ Terraform and Bicep modules already handle this.
Case 3: the MSP asks for Owner
Problem: the managed service provider wants Owner on the customer's subscription so it can “deploy policies.” Fix: Lighthouse does not support Owner. Instead, use Contributor as an eligible authorization (JIT + approval), a restricted User Access Administrator (can assign only specified roles to managed identities, for DINE remediation), and the Registration Assignment Delete Role. Changes that need higher privileges are made by the customer's own platform team.
Common errors and fixes
ManagedIdentityCredential authentication unavailable / Identity not found (IMDS returns 400)
Cause: the resource does not have the managed identity attached; there is more than one UAMI and no client_id is specified; or the container cannot reach IMDS.
az vm identity show -g rg-lz-myapp-cc -n vm-mitest-cc -o json az containerapp identity show -g rg-lz-myapp-cc -n <app> -o json
Fix: attach the UAMI and specify the client ID in the code or the CLI.
(Forbidden) Caller is not authorized to perform action on resource … Action: 'Microsoft.KeyVault/vaults/secrets/getSecret/action'
Cause: the managed identity has no data-plane role, the vault uses the access policy model instead of RBAC, or the permission was just granted through a group.
Fix: confirm enableRbacAuthorization=true, then assign Key Vault Secrets User directly at the vault scope.
Lighthouse deployment failed: The role definition … is not supported / Owner is not supported
Cause: the authorization uses Owner, a custom role, a role with DataActions, or a role with Microsoft.Authorization write operations.
Fix: switch to a supported built-in role. When you need to authorize managed identities, use User Access Administrator + delegatedRoleDefinitionIds.
Managing-side users cannot see the delegation under “My customers,” or cannot activate an eligible role
Cause: the standing Reader-type authorization is missing; the managing tenant lacks the ID Governance license for eligible authorizations; or the group type is not “Security.”
Fix: add a Reader authorization for the same principal; confirm the license; rebuild the group as a security group and update the delegation.
1. On the VM with the UAMI attached (client ID $CID), sign in with the managed identity from the CLI and read the secret redis-connection.
az login --identity --client-id $CID az keyvault secret show --vault-name $KV -n redis-connection --query value -o tsv
2. List all Lighthouse delegations in the customer tenant.
az managedservices assignment list --include-definition true -o table
The parent company wants to monitor the ALZ in three subsidiary tenants (each a separate tenant). Requirements: the parent's SOC has read-only access, the platform team occasionally needs to change diagnostic settings, and each subsidiary can revoke access at any time. How would you design this?
Deploy Lighthouse delegations at subscription level in each subsidiary's tenant, covering the platform subscription and the landing zone subscriptions. The SOC security group gets Reader and Security Reader. The platform team group gets an eligible authorization for Monitoring Contributor (JIT, 4 hours, with approvers from the parent company; the parent company's tenant needs the ID Governance license), plus standing Reader. If DINE remediation must run in the subsidiary's tenant, add User Access Administrator and use delegatedRoleDefinitionIds to limit it to assigning monitoring-related built-in roles to managed identities. Add the Registration Assignment Delete Role. A subsidiary can remove the delegation at any time under “Service providers,” and all actions are recorded in the subsidiary's activity log. Note that Lighthouse does not support Owner or custom roles.
Verified teaching videos
Official docs and further reading
- Managed identity best practice recommendations (including authorization caching limits)
- Lighthouse: tenants, users, and roles (role support rules) · Create eligible authorizations
- CAF: Lighthouse in a multi-tenant ALZ
Video storyboard (about 90 seconds)
Visual: a container raises its hand to 169.254.169.254 and gets back a token, which opens the Key Vault door.
Narration: the platform manages the managed identity's credentials. The workload only asks the local endpoint for a token.
Visual: a managed identity is dragged into a group, and the clock runs for 24 hours before a green light comes on.
Narration: tokens are cached. To grant access to a managed identity, assign the role directly.
Visual: two tenants. An “authorization list” appears in the customer tenant, and a managing-side user works on the customer's subscription through it.
Narration: Lighthouse stores the authorizations as resources in the customer tenant. The managing side needs no guest accounts.
Visual: the Owner card is crossed out. The built-in role cards pass.
Narration: only built-in roles are supported, not Owner. For temporary elevation, use an eligible authorization.
Module 8 · Identity review and troubleshooting
- Use the
authorizationresourcestable in Azure Resource Graph to inventory high-privilege assignments, assignments made directly to users, guest assignments, orphaned assignments that show “Identity not found,” and elevated access at the root scope. - Set up continuous governance: access reviews for PIM and groups, alerts on role assignment changes, break-glass account drills, and license monitoring.
- Use the troubleshooting tree to tell apart
AuthorizationFailed(RBAC),RequestDisallowedByPolicy(Policy or enforced MFA),AADSTS…(Entra token), and cache delay.
What: eight questions an identity review should answer
| # | Question | Data source | Target |
|---|---|---|---|
| 1 | Who has Owner, User Access Administrator, or RBAC Administrator on alz / platform / subscriptions? | Resource Graph | Only PIM eligibility or the platform apply identity |
| 2 | Are any roles assigned directly to individual users? | Resource Graph (principalType = User) | Change them all to groups |
| 3 | What roles do guests have on Azure? | Graph (userType = Guest) + Resource Graph | Has an owner and an expiry date |
| 4 | Is there still elevated access at the root scope /? | az role assignment list --scope /, the banner on the Entra properties page | Empty |
| 5 | Are there assignments that point to deleted principals? | The portal shows Identity not found / principalName is empty in the CLI | Delete |
| 6 | Are all federated credentials on the deployment identities bound to protected environments? | az identity federated-credential list | apply / prod: environment-bound only |
| 7 | Are the most recent break-glass account drill and sign-in alerts normal? | SigninLogs, drill records | ≤ 90 days |
| 8 | Are the PIM / ID Governance licenses valid, and is the count sufficient? | Entra licenses page, subscribedSkus | Alert 30 days before expiry |
How: the mechanisms of continuous governance
- Access reviews: run periodic reviews of PIM roles, PIM for Groups, and privileged groups (as the CAF recommends). Entra ID P2 provides access reviews that have been generally available for some time. Newer capabilities, such as reviews for PIM for Groups, machine-learning recommendations, and inactive-user scoping, require ID Governance.
- Alerts: the Azure Activity Log for
Microsoft.Authorization/roleAssignments/write(at management group and subscription level), and, in the Entra audit log, PIM activations and “Azure RBAC (Elevated Access)” events. Microsoft Sentinel has an “Azure RBAC (Elevate Access)” analytics rule template. - Identity as code: keep role assignments, custom roles, PIM eligibility, and federated credentials in the platform IaC wherever possible, and review changes through PRs. Find manual changes with a Resource Graph drift report.
- Capacity: 5000 role assignments per subscription, 500 per management group, 5000 custom roles per tenant, and 20 federated credentials per identity. Show the utilization of each in the report.
Four root causes of authorization failure
| Symptom | Source | Typical causes | Go back to |
|---|---|---|---|
AuthorizationFailed (403) | ARM RBAC | No assignment, wrong scope, NotActions, condition not met, PIM not activated | Modules 2, 3, 4 |
RequestDisallowedByPolicy | Azure Policy or enforced MFA | Deny policy; “Users must use MFA for Create/Update operations” | Hour 2, Module 5 |
AADSTS… | Entra token issuance | CA block (53003), MFA required (50076), federated credential mismatch (700213 / 700212 / 70021) | Modules 5, 6 |
| 401 / a newly added permission does not take effect | Cache | ARM cache about 10 minutes; managed identities granted through a group can take hours | Modules 2, 7 |
Review loop
Interactive: identity review scorecard
Check off the items for your environment (or this course's sandbox). The scorecard calculates a score weighted by risk and lists the priority fixes. Results are saved in this browser.
Core commands: inventory and audit
| Command | Purpose |
|---|---|
az graph query -q "authorizationresources | …" --management-groups alz | List role assignments under alz (including at management group level) |
az role assignment list --scope / -o table | Assignments at the root scope (elevated access) |
az role assignment list --all --query "[?principalName=='']" | Suspected orphaned assignments |
az monitor activity-log list --offset 7d --query "[?authorization.action=='Microsoft.Authorization/roleAssignments/write']" | Role assignment changes in the last 7 days (subscription level) |
az rest --url "https://graph.microsoft.com/v1.0/users?\$filter=userType eq 'Guest'" | List guests |
az graph query --management-groups alz --first 1000 -q "
authorizationresources
| where type =~ 'microsoft.authorization/roleassignments'
| extend rdId = tolower(tostring(properties.roleDefinitionId)), principalType = tostring(properties.principalType),
principalId = tostring(properties.principalId), scope = tostring(properties.scope)
| join kind=leftouter (authorizationresources
| where type =~ 'microsoft.authorization/roledefinitions'
| project rdId = tolower(id), roleName = tostring(properties.roleName)) on rdId
| where roleName in ('Owner','User Access Administrator','Role Based Access Control Administrator') or principalType == 'User'
| project scope, roleName, principalType, principalId
| order by roleName asc" --query "data" -o table
Scope RoleName PrincipalType PrincipalId ----------------------------------------------------- ------------------------- ---------------- ------------ /providers/Microsoft.Management/managementGroups/alz Owner ServicePrincipal 7c1e… ← id-alz-platform-apply (expected) /subscriptions/1111… Owner User 4b2a… ← standing personal Owner (risk) /subscriptions/1111… Role Based Access Control Administrator Group 9d0f… ← conditional? Needs checking / User Access Administrator User 0a9c… ← elevated access not revoked
How to verify: resolve each principalId to a name with az ad sp show --id / az ad user show --id / az ad group show -g. For conditional assignments, check the properties.condition field. Common error: using az role assignment list without --all, which misses other subscriptions.
Lab 8: generate an identity review report and fix five kinds of risk (about 10 minutes)
-o json > ra-report.json.az rest --url "/subscriptions/$LZ_SUB/providers/Microsoft.Authorization/roleEligibilityScheduleInstances?api-version=2020-10-01" \
--query "value[].{principal:properties.principalId, role:properties.expandedProperties.roleDefinition.displayName, end:properties.endDateTime}" -o tablefor id in $(az identity list --query "[].id" -o tsv); do
az identity federated-credential list --ids $id 2>/dev/null --query "[].{subject:subject}" -o tsv | sed "s#^#$(basename $id): #"
done
If the subcommand does not accept --ids, use -g and --identity-name instead (parse them from the id). The subject of the apply / prod identities should not contain ref:refs/heads/.
grp-lz-myapp-prod-access-admins has a condition; ⑤ record the date of the last break-glass drill.
az role assignment delete --assignee $(az ad signed-in-user show --query id -o tsv) --role "User Access Administrator" --scope "/" az role assignment list --scope "/" -o table # should be empty
law-alz-mgmt-cc through Entra / diagnostic settings first, then covered with log alerts):
az monitor activity-log alert create -g rg-alz-mgmt-cc -n ala-roleassignment-write \ --scopes /subscriptions/$LZ_SUB --condition category=Administrative and operationName=Microsoft.Authorization/roleAssignments/write \ --description "Role assignment created in landing zone" -o none
An alert sends notifications only when it is linked to an action group. See the management subscription resources in hour 1.
Case 1: a departed employee's Owner role is still there
Problem: an employee left and their account was deleted, but the Owner assignment on a subscription still shows “Identity not found.” A service principal created from their personal account still has Contributor. Fix: delete orphaned assignments during the quarterly inventory. Add service principals to the owner field and to access reviews. After moving to groups + PIM, a departure only requires removing the person from the group.
Case 2: elevated access at the root scope was never revoked
Problem: two years ago an administrator raised their access to troubleshoot, and they still have User Access Administrator at the root scope. Fix: the banner on the Entra properties page and “Manage users with elevated access” can be used to remove them in bulk. The Sentinel “Azure RBAC (Elevate Access)” rule detects new elevation events. The CAF recommends keeping this switch set to “No” when it is not needed.
Case 3: “RequestDisallowedByPolicy” misdiagnosed as a permissions problem
Problem: to fix RequestDisallowedByPolicy, the operations team added Owner to an automation account, but the problem remained. Cause: the account is a user-type service account, and Azure enforced MFA blocked it (the error message says MFA is required). Fix: revoke the extra Owner and move to a managed identity.
Interactive troubleshooting tree: authorization / sign-in failures
Start from the symptom you see and narrow it down step by step. Each leaf gives a diagnostic command and a fix.
Quick reference: common errors
Get-AzRoleAssignment still shows a deleted assignment
Cause: PowerShell uses a cache when listing assignments, refreshed about every 10 minutes.
Fix: list by scope, then filter: Get-AzRoleAssignment -Scope /subscriptions/$subId | Where-Object ObjectId -eq $id.
Insufficient privileges to complete the operation (service principal running az role assignment create)
Cause: the CLI tries to look up the assignee in Entra, but the service principal has no directory read permission.
Fix: use --assignee-object-id + --assignee-principal-type to skip the directory lookup.
1. List all role assignments at the root scope /.
az role assignment list --scope "/" -o table
2. Use Resource Graph to count role assignments per subscription (check against the 5000 limit).
az graph query -q "authorizationresources | where type =~ 'microsoft.authorization/roleassignments' | where id startswith '/subscriptions' | extend sub = tostring(split(id,'/')[2]) | summarize n=count() by sub | order by n desc"
myapp's pipeline suddenly reports RequestDisallowedByPolicy, and the team asks to “add Owner to the pipeline.” How do you investigate?
First read the error details. If they include a policy assignment ID and a definition name (such as one that denies public IPs), it is an Azure Policy from hour 2: change the template or request an exemption. Adding permissions does not help. If it says “MFA is required / Users must use MFA for Create/Update operations,” the pipeline is actually using a user account (someone may have switched the service connection to personal credentials). Migrate it to a UAMI with federated credentials, as in Module 5. Only AuthorizationFailed is an RBAC problem, and then you should add the narrowest role needed, not Owner.
Verified teaching videos
Official docs and further reading
- Troubleshooting Azure RBAC · Troubleshooting RBAC limits (Resource Graph queries)
- Create access reviews in PIM
- Elevated access: view and remove, audit logs, Sentinel rules
Video storyboard (about 90 seconds)
Visual: the results of a Resource Graph query, with four rows boxed in red.
Narration: run an inventory every quarter. Look for standing Owner, personal assignments, orphaned assignments, and root-scope elevation.
Visual: four error codes sorted into four buckets: RBAC, Policy/MFA, token, and cache.
Narration: when authorization fails, check the error code first. It tells you which layer the problem is in.
Visual: an access review email, where the reviewer clicks “Remove.”
Narration: access reviews give permissions an expiry date, instead of letting them pile up forever.
Visual: the loop arrow returns to inventory.
Narration: inventory, fix, review, monitor, and repeat. That is how the identity baseline avoids drifting.
Command cheat sheet
Tenants and management groups
az account show --query "{sub:name, tenant:tenantId, home:homeTenantId}"
az account tenant list -o table
az account management-group show -n alz -e -r
az rest --method post --url "/providers/Microsoft.Authorization/elevateAccess?api-version=2016-07-01"
az role assignment delete --assignee <me> --role "User Access Administrator" --scope "/"Role assignments
az role assignment create --assignee-object-id <oid> --assignee-principal-type Group \ --role <role> --scope <scope> az role assignment list --assignee <id> --all --include-inherited -o table az role assignment list --scope <scope> --include-inherited -o table az role assignment create … --condition "<abac>" --condition-version "2.0" # Owner 8e3af657… Contributor b24988ac… Reader acdd72a7… # UAA 18d7d88d… RBAC Admin f58310d9… AcrPull 7f951dda…
Custom roles
az provider operation show --namespace Microsoft.Compute \
--query "resourceTypes[?name=='virtualMachines'].operations[].name"
az role definition create --role-definition @role.json
az role definition update --role-definition @role.json # includes Id
az role definition list --custom-role-only true --query "[].{n:roleName, s:assignableScopes}"
# Limits: 5000 per tenant; AssignableScopes can contain only 1 MG, not "/", and no wildcards; DataActions cannot be assigned at MG scopePIM (Azure resource roles)
S=/subscriptions/<sub>; API=api-version=2020-10-01 az rest -m put --url "$S/providers/Microsoft.Authorization/roleEligibilityScheduleRequests/$(uuidgen)?$API" --body @eligible.json # AdminAssign az rest -m put --url "$S/providers/Microsoft.Authorization/roleAssignmentScheduleRequests/$(uuidgen)?$API" --body @activate.json # SelfActivate, PT2H az rest --url "$S/providers/Microsoft.Authorization/roleEligibilityScheduleInstances?$API" # License: Entra ID P2 or ID Governance; activation 1–24h; settings are not inherited
Break-glass accounts and Conditional Access
az ad user create --user-principal-name bg-admin01@<tenant>.onmicrosoft.com --display-name "Emergency Access 01" --password <pwd>
az rest -m post --url https://graph.microsoft.com/v1.0/roleManagement/directory/roleAssignments \
--body '{"principalId":"<oid>","roleDefinitionId":"62e90394-69f5-4237-9190-012177145e10","directoryScopeId":"/"}'
az rest --url https://graph.microsoft.com/v1.0/identity/conditionalAccess/policies --query "value[].{n:displayName,s:state}"
# Set CA policies to enabledForReportingButNotEnforced first; exclude grp-alz-emergency-access
# Enforced MFA: phase 1 portal from 2024-10; phase 2 CLI/PS/IaC/REST write operations from 2025-10-01Deployment identity (federated credential)
az identity create -g <rg> -n id-alz-platform-apply -l canadacentral az identity federated-credential create -g <rg> --identity-name id-alz-platform-apply -n gh-env \ --issuer https://token.actions.githubusercontent.com \ --subject "repo:<org>/<repo>:environment:alz-apply" --audiences api://AzureADTokenExchange az identity federated-credential list -g <rg> --identity-name <id> -o table # Up to 20 per identity; no wildcards; propagation delay → AADSTS70021; subject mismatch → AADSTS700213
Managed identity
az vm identity assign -g <rg> -n <vm> --identities <uami-resource-id> az login --identity --client-id <clientId> curl -H Metadata:true "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://vault.azure.net&client_id=<clientId>" # Assign roles directly to the managed identity (group-based grants can take hours to take effect)
Lighthouse and review
az deployment sub create -l canadacentral -f subscription.json -p @subscription.parameters.json az managedservices assignment list --include-definition true -o table az graph query --management-groups alz -q "authorizationresources | where type =~ 'microsoft.authorization/roleassignments' | summarize count() by tostring(properties.principalType)" # Lighthouse: built-in roles only; no Owner; no roles with DataActions; eligibility grants require ID Governance in the managing tenant
Error code quick reference
| Error | Layer | What to do first |
|---|---|---|
AuthorizationFailed | RBAC | az role assignment list --assignee … --all --include-inherited |
… or an ABAC condition not fulfilled … | RBAC conditions | Check the condition on the delegate's assignment |
RequestDisallowedByPolicy … MFA is required | Enforced MFA | Add MFA for interactive users; move automation to workload identities |
RequestDisallowedByPolicy (includes the policy assignment name) | Azure Policy | See hour 2 |
AADSTS53003 | Conditional Access | Sign-in logs → Conditional Access tab |
AADSTS700213 / 700212 / 70021 | Federated credential | Check subject / audience; wait for propagation |
PrincipalNotFound | Replication delay | Specify principalType |
RoleDefinitionHasAssignments | Custom role | Delete the assignment first (including PIM eligibility) |
Capstone lab + final quiz
sub-lz-corp-myapp, and prove that the platform boundary has not been breachedcorp. Security review requires: ① the team can manage resources on its own, but cannot change networking or grant access to anyone; it can only assign allowlisted roles to groups or service principals; ② high-privilege production access is only activated through PIM, with approval; ③ production deployments may come only from the prod environment of the myapp repository, with no secrets; ④ the application reads Key Vault secrets through a managed identity; ⑤ the tenant has two working emergency accounts, and the CA baseline is already live; ⑥ platform and application identities are fully isolated; ⑦ an identity review report can be produced. If you have only one subscription, replace the subscription scope with rg-lz-myapp-cc.grp-lz-myapp-prod-owners → Application-Owners @ subscription; grp-lz-myapp-prod-access-admins → RBAC Administrator + conditions (Reader / AcrPull / Key Vault Secrets User, Group and ServicePrincipal only, write and delete branches); grp-lz-myapp-prod-operators → Landing Zone VM Operator @ rg-lz-myapp-cc.
az role assignment list --scope /subscriptions/$LZ_SUB --include-inherited \
--query "[].{who:principalName, role:roleDefinitionName, cond:condition!=null}" -o tablegrp-lz-myapp-prod-breakfix and give it eligibility for Owner on the subscription: activation for 2 hours, phishing-resistant MFA (authentication context), a justification is required, and two approvers (application owner + platform on-call). If you don't have the license, record it as a “read-only walkthrough.”id-lz-myapp-prod-deploy (UAMI) + federated credential repo:contoso/myapp:environment:prod + Application-Owners @ subscription; set required reviewers on the GitHub environment prod.
az identity federated-credential list -g rg-lz-myapp-cc --identity-name id-lz-myapp-prod-deploy --query "[].subject" -o tsv
id-myapp-cc → Key Vault Secrets User @ kv-myapp-cc-<suffix> (assigned directly, not through a group).grp-alz-emergency-access; CA01 is report-only → observe for one week → enable; the SigninLogs alert has fired once during a drill.app-dev1, try to change a policy assignment on corp, assign Owner to yourself, and create a VNet. All three should fail. The myapp deployment identity has no roles on alz or platform.
az policy assignment delete --name Deny-Public-IP-On-NIC --scope /providers/Microsoft.Management/managementGroups/corp # Expect AuthorizationFailed
id-myapp-cc and the test VM's network).Open-ended self-check (6 questions)
1. Why does ALZ place Landing Zone role assignments at subscription / resource group, but policy at management group?
Application teams have full autonomy in their own subscriptions, yet cannot change the policy assignments that govern them (policy is written at a higher management group, where the application teams have no roles). This reflects two design principles: “subscription democratization” and “policy-driven governance.”
2. A user holds both Application-Owners and Network-Management. Can they write a VNet? Why?
Yes. Effective permissions are the union of each role's (Actions − NotActions). Application-Owners' NotActions do not block the Microsoft.Network/* granted by Network-Management. To truly prevent this, you need a deny assignment (such as a deployment stack denySettings) or Azure Policy.
3. What happens when a PIM license expires? How do you prevent it?
Eligibility assignments are deleted, time-bound active assignments become permanent, PIM can no longer activate or manage roles, and the review ends. Prevention: alert before the license expires; keep enough licenses; prepare export and recovery procedures; emergency accounts should not depend on PIM.
4. A Terraform nightly job starts reporting MFA errors after October 2025. What are the likely causes, and what is the correct fix?
The job signs in with a user account (username and password, or a cached personal session), and phase 2 enforced MFA applies to CLI and IaC write operations. The correct fix is to switch to a service principal with a managed identity or federated credentials (workload identities are not affected), not to exempt the account or add permissions.
5. Why should the apply identity's federated credential be bound to an environment rather than the main branch?
Entra only does string matching; anyone or any workflow that can push to main gets a token for ref:refs/heads/main. An environment can require reviewers and restrict branches, so control over who gets an Owner-level token moves into the approval process.
6. When an acquired company's tenant joins group governance, what can Lighthouse do, and what can't it do?
It can use built-in roles (including JIT eligibility-based grants) to let the group team have read-only or limited operational access on the subsidiary's subscriptions, and assign a specified role to a managed identity to run DINE remediation. The subsidiary can revoke this at any time. It cannot grant Owner, custom roles, roles with DataActions, or general access management. The subsidiary tenant still needs to deploy its own ALZ, PIM, CA, and emergency accounts.
Sources and versions
| Topic | Verification result | Sources (accessed 2026-11-18) |
|---|---|---|
| ALZ identity design | CAF sample role assignment table; platform and application team responsibilities; a separate group for each Landing Zone; roles assigned to groups; policy at MG, roles at subscription / RG; conditional delegation; PIM for Groups; DINE remediation identities may only use built-in roles; fewer than 5 Global Administrators | CAF: Landing zone identity and access management |
| ALZ custom roles and management groups | Library platform/alz/2026.11.0: the root prototype has 5 roles (Subscription-Owner, Application-Owners, Network-Management, Network-Subnet-Contributor, Security-Operations), with permissions as described in the main text; management group IDs have no prefix (alz, platform, landingzones, corp, online, local, sandbox, decommissioned, management, connectivity, identity, security) | Azure-Landing-Zones-Library |
| Multi-tenant | Start with a single tenant; in a multi-tenant setup, deploy ALZ separately in each tenant; licenses do not cross tenants; use sandbox and administrative units instead of new tenants; Lighthouse, B2B, and cross-tenant sync are recommended | CAF: multitenant considerations |
| RBAC limits and troubleshooting | 5,000 assignments per subscription (fixed; eligibility not counted), 500 per MG, 5,000 custom roles per tenant; changes take up to about 10 minutes to apply; group-based grants for managed identities are cached for about 24 hours; PrincipalNotFound and principalType; transferring a subscription permanently deletes its role assignments | troubleshoot-limits · troubleshooting |
| Custom roles | AssignableScopes cannot be /, no wildcards, only one MG, up to 2,000 entries; roles with DataActions cannot be assigned at MG scope; one wildcard per operation string | Azure custom roles |
| Conditional delegation | Condition syntax, role IDs for Owner / RBAC Admin / UAA / Reader / AcrPull, conditionVersion 2.0 | delegate-role-assignments-examples |
| Elevated access | Root-scope User Access Administrator; elevateAccess?api-version=2016-07-01; audit logs and Sentinel rules; removal methods | elevate-access-global-admin |
| PIM licensing and settings | Requires Entra ID P2 or ID Governance; counted objects; consequences of expiry (eligibility deleted, time-bound becomes permanent); new IGA features only in ID Governance; activation 1–24 hours; no default approvers; settings not inherited; least-privilege activation (preview) | licensing-fundamentals · PIM role settings |
| Azure enforced MFA | Phase 1 from 2024-10 (portal, Entra, Intune; M365 admin center from 2025-02); phase 2 from 2025-10-01 (write operations in CLI, PowerShell, mobile apps, IaC, REST control plane, and SDKs); workload identities not affected; deferral deadlines 2025-09-30 / 2026-07-01; cannot opt out; public cloud only; CLI 2.76+ / PowerShell 14.3+; Conditional Access requires P1 | mandatory MFA · CLI troubleshooting |
| Emergency access accounts | ≥ 2 accounts, cloud-only on onmicrosoft.com, FIDO2 (recommended) or CBA, permanently active GA, excluded from blocking CA (report-only policies need no exclusion), alerts, validated at least every 90 days | security-emergency-access |
| Workload identity federation | Up to 20 FICs per app / UAMI; no wildcards; issuer + subject must be unique; single-value audience; propagation delay (AADSTS70021); concurrent UAMI creation returns 409; UAMI FIC not yet supported in Malaysia South; flexible FIC is in preview and not supported for managed identities | WIF considerations · flexible FIC |
| ALZ accelerator deployment identities | Terraform: plan UAMI = Reader @ intermediate root + Storage Blob Data Contributor on the state container; apply UAMI = Owner @ intermediate root + the same state container; Bicep What-If UAMI = Reader + whatIf/validate custom role | Accelerator permissions FAQ |
| Azure Lighthouse | Built-in roles only; Owner, roles with DataActions, and roles with Microsoft.Authorization write operations are not supported; UAA is used only to assign roles to managed identities; security groups; Registration Assignment Delete Role (91c1777a…); eligibility grants require the managing tenant to have an ID Governance license, 30 minutes to 8 hours, up to 10 approvers, and service principals are not supported | tenants-users-roles · eligible authorizations |
Video verification notes
All videos below were verified for title and channel through the YouTube oEmbed endpoint (2026-11-18): John Savill's Technical Training: “Exploring the Real Relationship Between Azure AD and Azure Subscriptions” (sXurr46f3HA), “Azure AD Cross-Tenant Access Settings Deep Dive” (Ku64fo7iZ4Y), “Azure AD B2B Overview” (iUGezQj4BpY), “Azure Role-Based Access Control Deep Dive” (qFoHDTxkQII), “Azure Master Class v2 - Module 3 - Governance” (eLSjnF6Crlw), “Azure AD Administrative Units Overview” (1-x86jJuK7c), “Azure AD Privileged Identity Management (PIM) - AZ-500, SC-300 Deep Dive Topic” (gccgIkR8_a0), “Azure Master Class v3 - Part 2 - Identity” (megA6BPpYqo), “Azure AD Conditional Access Overview” (G0pyhveHJmg), “Stronger Azure AD Authentication” (ns_94ZXrbPI), “Using Conditional Access with Authentication Flows” (A1-kSuLLNLI), “GitHub Azure AD OIDC Authentication” (XkhkkLBkAT4), “Azure DevOps Workload Identity Federation with Azure Overview. NO MORE SECRETS!” (saTUeR_U3lA), “Microsoft Azure Managed Identity Deep Dive” (rC1TV0_sIrM), “Workload Identity Protection with Azure AD Identity Protection” (TASsrY_ilWc); Microsoft Developer: “Why use workload identity federation?” (WIs3IRCJhEo); Microsoft Azure: “Azure Lighthouse: A unified control plane for managing Azure at scale | Azure Friday” (x-Db_AFKCzM). Some videos use the older name Azure AD (now Microsoft Entra ID); the concepts still apply. No verified video was found that covers the two phases of Azure enforced MFA or ALZ custom roles specifically, so the corresponding modules provide storyboard scripts instead.
Voice narration notes
The “Voice” tab uses the browser's Web Speech API (speechSynthesis, en-US) to read the narration script aloud in real time. English terms are pronounced with en-US. Quality depends on the voices installed on the system. This course-generation environment cannot call a TTS service, so no MP3 is embedded; if you need offline audio, give the narration script to any TTS tool.
Known limitations
- None of the commands in this hour were run in a real tenant. The “expected output” examples are illustrative: IDs, names, times, and error text depend on your environment and version, and some error text is paraphrased.
- After deployment, the display names of ALZ custom roles may include a suffix (depending on the implementation of the
alzprovider / AVM module), so this hour uses the querystarts_with(roleName,'Application-Owners')to stay compatible. - For the PIM activation request API behavior where a group eligibility is activated by a member with their own principalId, follow the official REST documentation and portal behavior. If it fails, use the portal or PIM for Groups instead.
- The application IDs (Windows Azure Service Management API), role template IDs, and built-in authentication strength IDs in the Conditional Access JSON come from commonly used official values. Verify them with a Graph query before submitting. Azure CLI's default Graph token may not include
Policy.ReadWrite.ConditionalAccess. - Trial availability and entry points for Entra ID P2 / ID Governance follow what the portal shows. Without a license, the PIM and Conditional Access parts can only be done as read-only walkthroughs.
- Lighthouse needs two tenants to be fully verified. With a single tenant, only template validation is possible.
- The test VM (B1s) is billed hourly, so delete it right after the lab. Key Vault enters its soft-delete retention period after deletion.
- Times, state changes, and logs in the animations are illustrative and explain the mechanism. They are not the service's exact timing.