Skip to main content

Azure Key Vault Secret Reads Return 403 After a Workload Identity Change

High severity Target recovery 45mAzure Key Vault

Overview

Work out whether an Azure Key Vault 403 comes from an identity, RBAC, firewall or private DNS change, then restore least-privilege access to the secret.

Markdown, one checkbox per step, for pasting into a ticket.

Destructive operation

This intervention contains destructive operations. Proceed with extreme caution and ensure database backups exist before execution.

Diagnose

Symptom

What responders observe.

An Azure workload that used to read a Key Vault secret now gets HTTP 403 Forbidden after a change to its managed identity, deployment slot or service principal.

Detection

Metrics, logs and confirmation commands.

  1. From the workload context, run az account show --query '{tenant:tenantId,subscription:id,user:user}' and record the authenticated tenant and identity.

  2. Run az keyvault show --name <VAULT_NAME> --query '{id:id,rbac:properties.enableRbacAuthorization,publicNetworkAccess:properties.publicNetworkAccess}'.

  3. Run az role assignment list --assignee-object-id <PRINCIPAL_OBJECT_ID> --scope <VAULT_RESOURCE_ID> --include-inherited when the vault uses Azure RBAC.

  4. If the vault uses legacy access policies, inspect az keyvault show --name <VAULT_NAME> --query properties.accessPolicies.

  5. Read the Key Vault diagnostic logs and the full 403 inner error, which tell an authorisation failure apart from a firewall or private-endpoint DNS rejection.

  6. Resolve <VAULT_NAME>.vault.azure.net from the workload network and check it reaches the public or private endpoint you expect.

Commands in these steps

  • az account show --query '{tenant:tenantId,subscription:id,user:user}'
  • az keyvault show --name <VAULT_NAME> --query '{id:id,rbac:properties.enableRbacAuthorization,publicNetworkAccess:properties.publicNetworkAccess}'
  • az role assignment list --assignee-object-id <PRINCIPAL_OBJECT_ID> --scope <VAULT_RESOURCE_ID> --include-inherited
  • az keyvault show --name <VAULT_NAME> --query properties.accessPolicies

Root cause

Why the incident occurred.

  1. Either the redeployed workload now uses a different principal object ID or tenant from the identity that holds Key Vault data-plane permission, or its request arrives by a network path the vault firewall rejects.

  2. Azure control-plane access to the vault resource does not by itself grant data-plane access to secrets.

Contain and prevent

Blast radius

What else this can affect.

  • Applications using the changed identity cannot retrieve required secrets, keys, or certificates.

  • Dependent deployments can fail readiness checks or fall into restart loops.

  • An emergency role assignment with a broad scope could expose vault data beyond the affected workload.

Prevention

Controls and guardrails that stop it recurring.

  • Treat managed identity object IDs and Key Vault role assignments as deployment dependencies.

  • Monitor Key Vault 403 responses and retain data-plane diagnostic logs.

  • Test private DNS resolution and secret reads from the workload network during deployment validation.

  • Keep Azure RBAC assignments narrowly scoped, and manage them through reviewed infrastructure as code.

Fix

Pre-flight checks

Check these before you change anything.

  1. Confirm the exact principal object ID the failing workload uses; an application/client ID is not a substitute for it.

  2. Confirm the vault uses Azure RBAC; stop and use the approved legacy access-policy procedure if enableRbacAuthorization is false.

  3. Record all current role assignments at the vault scope and the current firewall/private endpoint configuration.

  4. Check DNS and the network path first: adding RBAC permission will not fix a firewall rejection.

  5. Confirm the least-privilege role required by the workload and obtain the vault owner's approval.

  6. Make sure the operator can remove the new assignment straight away if the scope or principal is wrong.

Commands

az role assignment create --assignee-object-id <PRINCIPAL_OBJECT_ID> --assignee-principal-type ServicePrincipal --role 'Key Vault Secrets User' --scope <VAULT_RESOURCE_ID>
az role assignment list --assignee-object-id <PRINCIPAL_OBJECT_ID> --scope <VAULT_RESOURCE_ID> --include-inherited

Verify and recover

Verification

Evidence required before you close the incident.

  1. Using the workload's own identity and network path, read the required non-test secret once more and confirm it succeeds without its value appearing in logs.

  2. Confirm Key Vault logs show the intended principal object ID and a successful data-plane operation.

  3. Verify the assignment scope is the individual vault rather than the subscription or management group.

  4. Confirm an unrelated principal remains denied.

  5. Monitor application health and Key Vault authorization failures for at least 15 minutes.

Rollback

The safe way back.

  1. If the assignment went to the wrong principal or grants access nobody intended, take the new assignment's exact ID from the role-assignment listing run after the change and remove it with az role assignment delete --ids <NEW_ASSIGNMENT_ID>.

  2. Re-run the denied-access test for the unintended principal, then restore service through the approved identity or network remediation path.

Commands in this rollback

  • az role assignment delete --ids <NEW_ASSIGNMENT_ID>

Escalate when

Conditions that need another owner.

  • The vault uses legacy access policies or a deny assignment prevents Azure RBAC access.

  • The 403 comes from private endpoint DNS, firewall policy or public-network restrictions, not from authorisation.

  • The workload's principal cannot be determined unambiguously.

  • Recovery would require subscription-wide access or a role broader than the approved data-plane action.

The KBY Brief

Fixed? Get the next one before it hits you: The KBY Brief

Practical fixes for the systems you run, by email about twice a week. Unsubscribe at any time.

About this page

Credited to

Dates

Published

Last updated

Corrections

No corrections are listed for this page. Some review sweeps corrected pages without naming each one; those are in the corrections log.

Was this useful?

Reports go to the site owner and are used to correct pages. Corrections are listed at /corrections.

Sources

Based on the vendor sources listed below. Check each step against your environment before acting.

First published 21 August 2026 · Last updated 16 November 2026