Infrastructure
Azure RBAC: validate role propagation and token caching before widening scope
A production runbook for diagnosing a 403 after an Azure RBAC assignment, separating scope, dataActions, propagation and managed identity token caching, then validating or rolling back without adding a broader role.
A managed identity receives the expected role on an Azure Key Vault. The assignment is visible in the portal and Azure CLI, but the application still gets 403 responses. Under pressure, teams often restart the workload repeatedly or add Contributor at resource-group scope. Neither action proves that the original assignment became effective.
The running case is an App Service that must read a secret after a deployment. The same runbook applies to Storage, Service Bus or an API protected by Microsoft Entra ID. Its goal is to separate a bad assignment from propagation delay, cached identity tokens and another authorization plane, then choose a bounded wait, a minimum correction or rollback.
Freeze the access contract and timeline
Before changing anything, record the identity that should act, the role, the exact scope, the denied operation and every relevant UTC timestamp. “The role exists” is insufficient when the principal, scope or permission does not match the call.
incident: INC-IAM-416
detected_utc: 2026-10-16T08:20:00Z
workload:
resource: app-orders-prod
identity_type: UserAssigned
expected_principal_id: <principal-id>
target:
resource_id: /subscriptions/<sub>/resourceGroups/rg-security-prod/providers/Microsoft.KeyVault/vaults/kv-orders-prod
authorization_model: AzureRBAC
operation: secrets/get
assignment:
assignment_id: <role-assignment-id>
role_definition: Key Vault Secrets User
created_utc: 2026-10-16T08:12:00Z
evidence:
first_403_utc: 2026-10-16T08:14:31Z
correlation_id: <correlation-id>
last_known_good_release: orders-2026.10.15-3
blocked_shortcuts:
- contributor_at_resource_group
- public_network_access
- repeated_unbounded_restart Retain the IaC definition or access request that created the assignment. The diagnosis must compare intent, control-plane state and the authorization observed by the target service.
Prove the principal, role and scope
Start with the principal identifier exposed by the running workload. An application or identity name is not a stable security key. A slot, revision, recreation or AZURE_CLIENT_ID setting can make a different Entra object act.
set -eu
PRINCIPAL_ID="<principal-id-from-running-workload>"
TARGET_SCOPE="/subscriptions/<sub>/resourceGroups/rg-security-prod/providers/Microsoft.KeyVault/vaults/kv-orders-prod"
az role assignment list --assignee-object-id "$PRINCIPAL_ID" --scope "$TARGET_SCOPE" --include-inherited --all --fill-principal-name false --query '[].{assignmentId:id,role:roleDefinitionName,roleId:roleDefinitionId,scope:scope,condition:condition,createdOn:createdOn}' --output json
az role definition list --name "Key Vault Secrets User" --query '[].{name:roleName,actions:permissions[].actions,dataActions:permissions[].dataActions,notDataActions:permissions[].notDataActions}' --output json Verify four things independently: principalId, scope inheritance, role definition and dataActions. A management role may allow vault configuration without allowing a secret read. Conversely, a correct data-plane permission cannot repair the wrong vault or a workload using another identity.
Locate the delay instead of calling everything propagation
“Propagation” covers several mechanisms with different evidence and timing.
Assignment missing from the control plane
Verify creation, scope, subscription and deployment state
Assignment visible, but principal, role or scope is wrong
Correct the contract; waiting will not change the outcome
Direct assignment is correct, call is still denied
Replay at bounded intervals and correlate target-service logs
Permission comes from group membership or a role carried in token claims
Account for the managed identity token cache per resource URI
No call appears in target logs
Return to token acquisition, audience, DNS, routing and firewall Direct Azure RBAC changes can take several minutes to become observable. Group membership or roles carried in token claims behave differently: managed identity infrastructure caches tokens per resource URI, potentially for several hours. There is no reliable command to force that platform cache to refresh before expiry.
An application restart may clear a local SDK cache, but it does not prove that the platform-managed cache was invalidated. Do not turn an unknown wait into a restart loop.
Correlate the denial at the target service
The ARM-side assignment must be connected to a real call. For Key Vault, find the principal, operation, result and correlationId in the tables that are actually enabled. The query below is intentionally adaptable across collection modes.
let StartTime = datetime(2026-10-16T08:10:00Z);
let EndTime = datetime(2026-10-16T09:00:00Z);
let ExpectedPrincipal = "<principal-id>";
AzureDiagnostics
| where TimeGenerated between (StartTime .. EndTime)
| where ResourceProvider == "MICROSOFT.KEYVAULT"
| extend CallerObjectId = tostring(column_ifexists("identity_claim_oid_g", "")),
Result = tostring(column_ifexists("ResultSignature", ResultType)),
Correlation = tostring(column_ifexists("CorrelationId", ""))
| where Result has_any ("403", "Forbidden")
| project TimeGenerated, Resource, OperationName,
CallerObjectId, Result, Correlation, CallerIPAddress
| order by TimeGenerated asc Three outcomes are useful. When the target sees the expected principal and denies the operation, stay with scope, role definition, an RBAC condition or propagation. When it sees another principal, fix the workload. When it sees no call, the incident sits before service authorization.
Build a canary that separates waiting from error
A useful canary replays the exact minimum operation from the same runtime, identity and audience. It adds a correlation identifier, writes no business data and stops after a defined window.
canary:
source: same_runtime_and_identity
target: dedicated_non_sensitive_object
positive_probe: one_secrets_get
negative_probe: dedicated_out_of_scope_control
interval: 2m
max_attempts: 5
retain:
- utc_timestamp
- principal_id
- token_audience
- http_status
- correlation_id
- target_log_result
stop_when:
- unexpected_write_succeeds
- caller_identity_changes
- target_receives_no_correlated_call
- authorization_scope_cannot_be_proven The negative probe matters as much as success. It confirms that the correction enables the intended operation without opening a neighboring scope. Use a non-sensitive control resource designed for denial; do not test a destructive write in production.
Avoid workarounds that destroy the evidence
Adding a broad role introduces a second variable and can hide the faulty assignment. Changing identity, scope, code and networking together makes success impossible to attribute. Disabling a firewall does not repair an RBAC denial already correlated to the right principal.
During diagnosis:
- create only one candidate assignment at a time;
- retain its exact identifier so it can be removed;
- do not combine an Entra group change with a direct assignment;
- do not use a token captured before the change as post-change evidence;
- keep the previous authorized release or identity available as the rollback path.
Decide: wait, correct or roll back
WAIT WITH A BOUND
Principal, role, dataActions and scope are proven
Assignment is recent and visible
Target sees the expected principal
Canary has no side effects and has a deadline
CORRECT
Runtime principal differs from assigned principal
Scope or role is wrong
dataActions are missing or an RBAC condition is incompatible
Target service uses another authorization model
ROLL BACK
User impact is active and delay exceeds the SLO
Previous identity or release remains qualified
A quick fix would require a broader role
Caller evidence or target logs are insufficient
BLOCK CLOSURE
Success only occurs with Contributor or Owner
No negative probe exists
Manual assignment is absent from IaC
Propagation window was not measured The cleanest rollback restores the last qualified workload-identity pair or removes a bad assignment by its exact identifier. It does not stack roles until the 403 disappears.
Validate and reconcile
Close the incident only when the same principal performs the intended operation, the target logs the success, the out-of-scope control remains denied and no temporary broad role remains. The assignment must live in the normal mechanism: Bicep, Terraform, an IAM workflow or an approved access request.
Finally, measure the delay between createdOn and the first successful canary. That local evidence helps set a realistic wait for the next change without turning one observation into a universal guarantee.
Conclusion
A visible role is not yet proven authorization. The complete chain connects the runtime principal, role and dataActions, scope, token, real request and target-service decision.
The runbook ends with an explicit choice: wait inside a bounded window when the contract is correct, repair the single wrong component, or roll back to an already authorized identity when production cannot absorb the delay. Widening scope is never evidence of propagation.