Azure / Advanced: secure and recoverable architecture / Lesson 21
Review Microsoft Entra workload federation
Compare issuer, subject and audience for a federated workload and verify resource access separately.
On this page
Lesson goals
- Explain external token exchange and federated identity credentials.
- Compare issuer, subject and audience precisely.
- Separate token exchange from target resource authorization.
- Compare exact federated claims and identify the failed boundary.
- Evaluate resource authorization separately from token exchange.
Define the trust relationship
Microsoft Entra workload identity federation allows an app registration or supported user-assigned managed identity to trust tokens from an external identity provider. The external workload exchanges an assertion for an Entra token without embedding a long-lived application secret in the workflow. Trust configuration and resource authorization remain separate decisions. The records here are synthetic and no token exchange occurs.
Record the expected claims
A conventional federated identity credential specifies issuer, subject and audience that must match the corresponding external token claims as documented. Matching is case-sensitive. The first record is a fictional expectation rather than a token or deployable credential. Validate the real identity provider, exact claim values and intended audience without storing the assertion or its signature in logs.
issuer: synthetic-issuer
subject: synthetic-workload
audience: approved-token-exchange
The record contains no credential and does not establish a trust relationship.
Compare the observed identity
The second record illustrates matching subject labels but deliberately leaves authorization unverified. Compare issuer, subject and audience together with the intended tenant and application or managed identity. An exact match of one field is insufficient. Avoid treating a friendly repository or workload label as proof of the actual subject issued by the external provider.
expected_subject: synthetic-workload
observed_subject: synthetic-workload
resource_authorization: separately-unverified
The record is not a token response or a real authentication result.
Authorize the resource separately
A successful token exchange does not grant every Azure resource operation. Review the Entra principal, target subscription, resource scope and role assignment for the requested action. If the exchange fails, investigate the trust configuration before changing Azure RBAC. If the exchange succeeds but access is denied, investigate authorization and the target rather than broadening the federation trust.
Verify both paths
In an authorized isolated lab, test a synthetic workload identity that matches the intended trust and a neighboring identity that must not match. Then test the permitted resource operation and an approved denial separately. Retain sanitized issuer, principal, target and timestamps without tokens. A passing test describes the tested configuration and time, not every workload or later change.
Map the exchange boundary
A workload presents an externally issued assertion to the Microsoft identity platform. The federated identity credential (FIC) on the intended app registration or supported user-assigned managed identity identifies an issuer, subject and audience accepted for exchange. These fields are compared case-sensitively. The identity provider defines the subject syntax; a familiar repository name or Kubernetes service-account label alone is not evidence of the actual `sub` claim. Record the exact issuer and subject alongside the selected tenant and identity, and compare the audience of the incoming assertion with the configured audience. A configured credential may be created even with a wrong subject, so a successful configuration operation does not establish that a workload can exchange its assertion.
Separate access from exchange
Treat exchange and resource access as different observations. After successful exchange, the principal still needs authorization for the intended operation and resource. A role assignment to a different principal, a sibling resource or a different subscription does not establish the intended access. Conversely, broadening a role cannot make an assertion with the wrong issuer match. Reviewers should record the failure stage before suggesting a change and avoid collecting assertions, access tokens or signatures in evidence. A sanitized claim comparison, timestamp, tenant, principal identifier, resource scope and requested operation can support review without storing a bearer credential.
Investigate propagation and preserve evidence
Microsoft documents a propagation interval after adding a FIC during which token requests may fail even if configuration looks correct. A transient mismatch immediately after a change is a hypothesis, not proof that propagation is the cause: first compare the selected identity and exact claims, then use bounded retries appropriate to the workload and preserve failure timestamps. A later success proves only that particular request at that time; it does not prove the neighboring subject is excluded or the requested resource permission is least privilege. In an authorized isolated environment, test one intended workload and one intentionally different subject, then test an allowed operation and a documented denial separately.
Compare claim values as issued
The issuer identifies the external identity provider, while the subject identifies the workload in that provider’s vocabulary. The audience identifies the intended recipient of the external assertion. Compare all three with the selected federated identity credential, including case and punctuation. A branch subject and an environment subject can describe different workflow contexts even when they come from the same repository. Copy neither from a friendly display name nor from a different deployment environment. Confirm the authoritative provider documentation and obtain sanitized observed claims through an approved process. A credential created with an incorrect subject may appear configured successfully while subsequent token exchange fails. Fix the authorized mismatch at its source and review the impact before changing trust.
Design positive and negative observations
A review should name the trusted workload, intended tenant and identity, the requested resource operation and the limits of its evidence. Test the intended assertion and a neighboring unauthorized subject separately in an isolated approved environment. Then test the allowed operation and an appropriate denied operation at the actual resource scope. These are four different observations: passing one does not imply the others. Record the time and configuration version because credentials, role assignments, workloads and provider claims can change. If a test cannot run, record it as untested rather than reporting an assumed denial or success. The fixtures below are fictional comparisons; they do not issue tokens, contact Azure or verify an actual deployment.
Assign an owner for each observation and distinguish the expected outcome from what was actually seen. An exchange error, a resource denial and an unavailable test environment call for different next steps. Preserve the relevant configuration identifiers and review time with each result so a later change does not silently inherit old evidence. Where a result is unexpected, record the uncertainty and investigate the narrow boundary before proposing broader permissions or changing the trusted workload.
20 worked examples
1. Exact claims
Problem: Do all three fictional claim values match the selected credential?
- All three values match in the record.
- Claim comparison passes; signature, lifetime, exchange and access remain unverified.
issuer=https://id.example/tenant-a
subject=repo:acme/pay:ref:refs/heads/main
audience=api://AzureADTokenExchange
observed=identical
This fixture performs no token exchange or Azure request.
Expected result: Claim comparison passes; signature, lifetime, exchange and access remain unverified.
Why this result follows: The configured and observed strings are equal, but other validation and authorization stages are absent.
2. Different issuer
Problem: Can a token from tenant-b match the tenant-a credential?
- The issuer strings identify different provider paths.
- This credential does not match; inspect the intended issuer.
expected_issuer=https://id.example/tenant-a
observed_issuer=https://id.example/tenant-b
subject_and_audience=match
This fixture performs no token exchange or Azure request.
Expected result: This credential does not match; inspect the intended issuer.
Why this result follows: Matching subject and audience cannot repair a different issuer.
3. Subject case
Problem: Does the branch subject match when its case differs?
- The final branch component differs in case. Exact matching includes the case of every character.
- The subject comparison fails.
expected_subject=repo:acme/pay:ref:refs/heads/main
observed_subject=repo:acme/pay:ref:refs/heads/Main
issuer_and_audience=match
This fixture performs no token exchange or Azure request.
Expected result: The subject comparison fails.
Why this result follows: The documented comparison is case-sensitive, so main and Main differ.
4. Wrong audience
Problem: Does this assertion satisfy the configured audience comparison?
- The two audience strings differ.
- The audience comparison fails; inspect assertion acquisition and configuration.
expected_audience=api://AzureADTokenExchange
observed_audience=api://other
issuer_and_subject=match
This fixture performs no token exchange or Azure request.
Expected result: The audience comparison fails; inspect assertion acquisition and configuration.
Why this result follows: A matching issuer and subject do not substitute for the expected audience.
5. Issuer slash
Problem: Is the observed issuer identical to the configured issuer?
- The observed issuer includes an additional trailing slash.
- The issuer comparison fails; verify the actual provider issuer before modifying trust.
expected_issuer=https://id.example/tenant-a
observed_issuer=https://id.example/tenant-a/
subject_and_audience=match
This fixture performs no token exchange or Azure request.
Expected result: The issuer comparison fails; verify the actual provider issuer before modifying trust.
Why this result follows: Exact string comparison distinguishes the slash from its absence.
6. Workflow context
Problem: Does a branch assertion match a credential configured for an environment?
- The subject represents an environment in one record and a branch in the other.
- The subject comparison fails; review which workflow context produced the assertion.
expected_subject=repo:acme/pay:environment:prod
observed_subject=repo:acme/pay:ref:refs/heads/main
issuer_and_audience=match
The fixture is illustrative and makes no Azure request.
Expected result: The subject comparison fails; review which workflow context produced the assertion.
Why this result follows: The two subject strings describe different contexts and are not equal.
7. Service account boundary
Problem: Can the writer service account use this reader credential?
- Both subjects name billing, but the service-account component differs.
- The writer assertion does not match this reader credential.
expected_subject=system:serviceaccount:billing:reader
observed_subject=system:serviceaccount:billing:writer
issuer_and_audience=match
The fixture is illustrative and makes no Azure request.
Expected result: The writer assertion does not match this reader credential.
Why this result follows: Sharing a namespace does not make different service-account subjects equal.
8. Selected identity
Problem: What does this claim comparison establish for the selected application?
- The only inspected credential belongs to app A, while the request selects app B.
- The result for app B is unknown until its credential and request are inspected.
app_A_fic=matching claims
selected_app=app_B
app_B_fic=not inspected
The fixture is illustrative and makes no Azure request.
Expected result: The result for app B is unknown until its credential and request are inspected.
Why this result follows: Federated credentials are attached to a particular application or supported identity.
9. Expired assertion
Problem: Can matching claims alone establish that this assertion will be accepted?
- The record places the request after the assertion expired.
- Claim equality does not establish a successful exchange; investigate token lifetime.
issuer_subject_audience=match
assertion_expiry=10:00 UTC
request_time=10:10 UTC
The fixture is illustrative and makes no Azure request.
Expected result: Claim equality does not establish a successful exchange; investigate token lifetime.
Why this result follows: Matching the three configured claims does not replace validity checks.
10. Signature not established
Problem: Do equal claims prove the external assertion is trusted?
- The claim comparison and signature validation are separate observations.
- Do not conclude exchange succeeds; investigate the issuer signing configuration.
issuer_subject_audience=match
signature_validation=failed
The fixture is illustrative and makes no Azure request.
Expected result: Do not conclude exchange succeeds; investigate the issuer signing configuration.
Why this result follows: Matching text does not make an assertion with failed signature validation trustworthy.
11. Propagation hypothesis
Problem: What should a reviewer conclude immediately after creating this credential?
- The failure follows creation, but the exact claims and identity have not been checked.
- Compare the selected credential and claims; propagation is a possible cause, not a proven one.
fic_created=12:00 UTC
request=12:01 UTC
error=AADSTS70021
claim_comparison=not recorded
The fixture is illustrative and makes no Azure request.
Expected result: Compare the selected credential and claims; propagation is a possible cause, not a proven one.
Why this result follows: Microsoft documents propagation delay, while the same symptom can accompany a mismatch.
12. Different principal
Problem: Does the listed assignment establish storage read access for principal P?
- The exchange identifies P, but the displayed role belongs to Q.
- P’s permission is unestablished; inspect its assignments and applicable scope.
exchange_principal=P
role=Storage Blob Data Reader
assignment_principal=Q
target=account-A
The fixture is illustrative and makes no Azure request.
Expected result: P’s permission is unestablished; inspect its assignments and applicable scope.
Why this result follows: An assignment to another principal does not itself grant P the role.
13. Sibling resource group
Problem: Does a role on group A cover the resource in group B?
- The resource is in a sibling group rather than beneath the listed scope.
- This assignment does not establish access to dataB; inspect relevant assignments for its scope.
principal=P
role_scope=/subscriptions/S/resourceGroups/A
target=/subscriptions/S/resourceGroups/B/providers/Microsoft.Storage/storageAccounts/dataB
The fixture is illustrative and makes no Azure request.
Expected result: This assignment does not establish access to dataB; inspect relevant assignments for its scope.
Why this result follows: A resource-group assignment applies within its scope, not to sibling groups.
14. Different operation
Problem: Does a successful read establish permission to delete the resource?
- The observed operation is read; delete is a separate requested action.
- Delete permission is unknown; inspect the applicable role and constraints.
principal=P
resource=R
read=success
delete=not_tested
The fixture is illustrative and makes no Azure request.
Expected result: Delete permission is unknown; inspect the applicable role and constraints.
Why this result follows: A successful read does not demonstrate authorization for a different action.
15. Wildcard credential
Problem: Can this conventional credential subject stand for every repository?
- The configured property contains a wildcard instead of a concrete subject.
- Do not treat this as a supported wildcard match; review a documented supported configuration.
credential_subject=repo:acme/*
intended_subjects=repo:acme/pay,repo:acme/inventory
The fixture is illustrative and makes no Azure request.
Expected result: Do not treat this as a supported wildcard match; review a documented supported configuration.
Why this result follows: Conventional federated identity credential property values do not support wildcard characters.
16. Description is not trust
Problem: Does the description establish that this credential trusts production?
- The description labels production, but the configured subject names development.
- Review the actual subject and intended workflow; the description does not establish production trust.
description=production deployment
subject=repo:acme/pay:environment:development
The fixture is illustrative and makes no Azure request.
Expected result: Review the actual subject and intended workflow; the description does not establish production trust.
Why this result follows: The description is informational and is not validated as a trust claim.
17. Duplicate trust pair
Problem: Can both proposed records be treated as distinct credentials on the same app?
- The issuer and subject pair is identical in both records.
- Inspect and update the existing trust as appropriate; the pair must be unique on the app.
app=payments
existing: issuer=https://id.example, subject=workload-A
proposed: issuer=https://id.example, subject=workload-A
The fixture is illustrative and makes no Azure request.
Expected result: Inspect and update the existing trust as appropriate; the pair must be unique on the app.
Why this result follows: A different credential label does not change the duplicate issuer and subject combination.
18. Concurrent creation conflict
Problem: What change to this provisioning plan addresses the observed conflict?
- Both creation requests target the same user-assigned identity at the same time.
- Serialize creation for that parent and inspect the resulting credential state.
parent=user-assigned-identity-A
create FIC-1 and FIC-2=concurrent
response=409 conflict
The fixture is illustrative and makes no Azure request.
Expected result: Serialize creation for that parent and inspect the resulting credential state.
Why this result follows: Microsoft documents that concurrent FIC updates on one user-assigned identity are unsupported.
19. Wrong target API
Problem: Does a successful exchange prove this token can be used at the requested API?
- The recorded token target and requested resource API differ.
- Review the token request and resource target; do not infer API-B access.
exchange=success
access_token_target=API-A
requested_resource=API-B
The fixture is illustrative and makes no Azure request.
Expected result: Review the token request and resource target; do not infer API-B access.
Why this result follows: An access token is intended for its target resource and exchange success alone does not authorize another API.
20. Bearer token in evidence
Problem: What should the reviewer do with this incident ticket evidence?
- The ticket contains a reusable credential where sanitized comparison evidence is sufficient.
- Follow the organization’s exposure response and retain sanitized evidence without the token.
ticket_contains=full bearer token
needed_evidence=issuer, subject comparison, principal, timestamp
The fixture is illustrative and makes no Azure request.
Expected result: Follow the organization’s exposure response and retain sanitized evidence without the token.
Why this result follows: A bearer token is sensitive, while identifiers and comparisons can support the review without revealing it.
Common errors and fixes
Subject matching ignores case or formatting
- Why it happens
- The configured and issued claim must match as documented.
- How to fix it
- Compare exact sanitized claim values and the trust configuration.
- Prevent it next time
- Test intended and nonmatching subjects.
Token exchange is treated as resource authorization
- Why it happens
- Trust and Azure RBAC are distinct boundaries.
- How to fix it
- Review the principal and exact resource role assignment.
- Prevent it next time
- Test each boundary separately.
A denial is fixed by broadening trust
- Why it happens
- The failure may be in the target or role assignment.
- How to fix it
- Identify the failed stage and propose a narrow correction.
- Prevent it next time
- Record issuer, audience, target and operation.
20 practice exercises
1. The issuer matches but subject differs in case. Is the trust match established?
Show hint
Compare the subject character by character, including case.
Show worked solution
No. Compare the exact documented claim values and correct the authorized configuration before retrying.
The issuer matching is only one part of the comparison. A subject that differs in letter case does not exactly match the configured subject, so this record does not establish the trust match. Confirm the authorized subject and the identity provider’s actual claim before changing either configuration.
Check your solution
- Identify the subject case difference.
- Do not infer a successful exchange from the matching issuer.
2. The exchange succeeds but an Azure resource operation is denied. What next?
Show hint
Locate the failure after exchange and review the actual caller and target.
Show worked solution
Inspect the principal, subscription, resource scope and role assignment for that operation; exchange success is not permission.
The exchange result establishes neither the role assignment nor the resource operation. Inspect the principal, subscription, target resource, requested action and applicable role scope and conditions. Preserve the denial evidence and propose a narrow correction only after identifying the missing authorization.
Check your solution
- Identify the principal and exact target.
- Review the role scope and action independently of federation trust.
3. A credential expects issuer https://id.example/a and subject build; an assertion reports https://id.example/b and build. What can you conclude?
Show hint
Compare each claim independently.
Show worked solution
The subjects match, but the issuer paths differ, so this credential does not match the assertion. Verify the authoritative issuer and intended identity before proposing a change; matching one field does not establish the exchange.
Check your solution
- Identify the issuer mismatch.
- Do not infer a successful exchange.
4. A FIC expects subject repo:team/app:ref:refs/heads/main, but the workflow emits repo:team/app:environment:prod. Diagnose the mismatch.
Show hint
Compare the whole subject, including context.
Show worked solution
The expected branch context differs from the observed environment context. Determine which workflow context is authorized, then review the corresponding exact subject and test it in an approved isolated environment.
Check your solution
- Identify branch versus environment.
- Require review of the intended workflow context.
5. The assertion audience is api://other while the FIC lists api://AzureADTokenExchange. Identify the failing comparison and next investigation.
Show hint
The audience belongs to the incoming assertion.
Show worked solution
The audience values differ, so the FIC audience comparison fails. Inspect how the workload requests its external assertion and verify the approved credential value; changing a resource role will not resolve that mismatch.
Check your solution
- Identify both audience values.
- Separate audience repair from resource RBAC.
6. A token exchange succeeds for principal P, but storage read is denied and the only listed reader assignment belongs to Q. What do you inspect?
Show hint
Map the role to the actual caller.
Show worked solution
Inspect P’s effective assignments, target storage scope and applicable conditions for the read. The assignment to Q does not establish P’s access, and successful exchange does not independently authorize the operation.
Check your solution
- Identify P and Q as different principals.
- Inspect the target action and role scope.
7. A FIC was created one minute before AADSTS70021; no observed claims were retained. Give two plausible investigation paths.
Show hint
Distinguish a hypothesis from a fact.
Show worked solution
Compare sanitized issuer, subject and audience against the selected identity’s credential, and consider documented propagation delay with bounded retries. Timing alone does not prove propagation; preserve timestamps and outcomes without storing assertions.
Check your solution
- Compare the exact selected trust and claims.
- Treat propagation as a hypothesis.
8. An app credential description says production, while its subject ends environment:test. Which field controls your trust review?
Show hint
A description is informational.
Show worked solution
Review the subject and other configured claim fields against the actual assertion. The production description cannot establish that a production subject matches; confirm intended context and correct any authorized configuration mismatch.
Check your solution
- Identify the test subject.
- Do not rely on the description for matching.
9. A role is assigned on resource group A; the requested storage account is in group B. Does this assignment establish access?
Show hint
Compare scope ancestry.
Show worked solution
No. The target is outside the assignment’s resource-group scope. Review the principal’s other applicable assignments and conditions on the actual target before deciding whether an authorized narrow role change is needed.
Check your solution
- Identify group B as outside group A.
- Inspect other applicable assignments before concluding effective access.
10. A review ticket contains a full external assertion plus issuer and subject comparisons. What evidence should remain?
Show hint
Avoid retaining bearer credentials.
Show worked solution
Follow the organization’s process for exposed credentials and remove the assertion from ordinary evidence. Retain sanitized claim comparisons, selected identity, target, timestamps and outcome as appropriate; never claim a test ran from the ticket alone.
Check your solution
- Identify the assertion as sensitive.
- Retain useful sanitized context without the token.
11. A subject differs only by uppercase Main versus lowercase main. Can a reviewer mark the federation match as established?
Show hint
Compare exact characters.
Show worked solution
No. The configured and observed subject values differ in case, and matching is case-sensitive. Confirm which branch context is authorized before correcting the credential or workflow, then repeat the approved comparison.
Check your solution
- Identify the case difference.
- Keep exchange success unverified.
12. A matching assertion is expired at 09:00, and the request arrives at 09:05. Are matching claims enough?
Show hint
Consider validity in addition to claim values.
Show worked solution
No. The fixture places the request after expiry. Investigate assertion issuance and clock context without storing the assertion; exact issuer, subject and audience do not prove that an expired assertion will be accepted.
Check your solution
- Identify the five-minute expiry gap.
- Separate claim matching from token validity.
13. A reviewer sees matching claim text, but signature validation failed. What conclusion follows from those observations?
Show hint
Separate identity claims from authenticity.
Show worked solution
The text matches, but the assertion has not passed signature validation. Investigate the issuer signing configuration and supported verification path; do not report a successful exchange or grant based on matching strings alone.
Check your solution
- Identify failed signature validation.
- Avoid claiming exchange success.
14. Two credentials on one app are proposed with the same issuer and subject but different names. What should the reviewer check?
Show hint
The trust pair matters more than its label.
Show worked solution
Inspect the existing credential first: the issuer and subject combination must be unique on the app. Different names do not make those trust pairs distinct; review the intended change instead of assuming both can coexist.
Check your solution
- Identify the duplicate pair.
- Distinguish the names from trust fields.
15. Two deployment tasks simultaneously create credentials under the same user-assigned identity and one reports 409. What plan change is appropriate?
Show hint
Consider the shared parent identity.
Show worked solution
Serialize the credential creation operations for that identity, then inspect the resulting state before retrying any missing operation. A conflict is evidence about this attempt, not proof that every credential was absent or created.
Check your solution
- Identify the shared parent.
- Require serial creation and state inspection.
16. A credential subject is repo:team/* and a reviewer expects it to cover two repositories. Is that conventional FIC match supported?
Show hint
Check the property syntax.
Show worked solution
No. Wildcard characters are not supported in conventional federated credential property values. Review the documented supported configuration and identify explicitly authorized workloads instead of assuming this pattern grants the intended trust.
Check your solution
- Identify the wildcard.
- Avoid treating it as a supported match.
17. An exchange succeeds for API A, but the workload calls API B. Does this observation establish access to API B?
Show hint
Inspect the intended token resource and requested target.
Show worked solution
No. Verify the requested access-token resource, API B requirements and authorization for the principal. The success at the exchange boundary alone neither proves the token is intended for API B nor grants its requested operation.
Check your solution
- Identify the API target difference.
- Review both token target and authorization.
18. A positive assertion test succeeds, but no neighboring subject has been tested. What does the result prove about exclusion?
Show hint
A positive test and negative test answer different questions.
Show worked solution
The observed positive case shows only its tested outcome at that time. It does not demonstrate exclusion of a different subject. Plan an authorized negative test using a clearly distinct subject and retain sanitized results.
Check your solution
- Limit the observation to the tested assertion.
- Specify a separate negative test.
19. An allowed storage read succeeds, while a denied deletion was never attempted. Can the review claim least privilege is verified?
Show hint
An unrun test has no observed outcome.
Show worked solution
No. Record the deletion test as untested and review the applicable role actions and conditions. If permitted by the test plan, perform an isolated approved negative test; do not invent a denial from a successful read.
Check your solution
- Mark deletion as untested.
- Separate read evidence from delete authorization.
20. A subject changes from development to production after the last review. Does the earlier test still prove current trust behavior?
Show hint
Bind evidence to the configuration and time tested.
Show worked solution
No. Compare the current authorized credential and issued claims, document the change and review its impact. Repeat the relevant positive and negative tests under authorization because the earlier result describes a different configuration.
Check your solution
- Identify the changed subject.
- Require current configuration evidence.
Key takeaways
- Federated trust compares external token claims with configuration.
- Issuer, subject and audience require precise review.
- Resource authorization is an independent boundary.
- Exact claims are necessary but do not establish complete token validation.
- Exchange and resource authorization require separate evidence.
- Synthetic fixtures do not demonstrate a real cloud outcome.