Key Vault RBAC — insufficient privileges for secret and certificate access
az keyvault secret show returns Forbidden: insufficient permissions
Focused incident mode — strips away everything but this runbook.
Symptoms
- az keyvault secret show returns Forbidden: insufficient permissions
- Application receives 403 from Key Vault when reading secrets or certificates
- Key Vault access policy is missing for the application identity
Evidence to grab
Collect these artifacts before you change anything — they prove (or rule out) each cause.
Key Vault access policy
az keyvault show --name <KV-NAME> --resource-group <RG> --query "properties.accessPolicies" -o jsonKey Vault RBAC role assignments
az role assignment list --scope <KV-SCOPE> --query "[].{role:roleDefinitionName,principal:principalName}" -o table
Diagnostic flow
Run the steps in order, marking each claim confirmed or refuted. The evidence you gather feeds the ranked causes below.
Guided decision tree is ready.
Steps with commands, expected output, and pass/fail branches.
Ranked root causes
Evidence checklist
- enableRbacAuthorization = false
- Identity objectId is absent from accessPolicies
Confirm before fixing
az keyvault show --name <KV-NAME> --resource-group <RG> --query "properties.accessPolicies[].objectId" -o tsvCheck access policy object IDs
Fix
az keyvault set-policy --name <KV-NAME> --resource-group <RG> --object-id <PRINCIPAL-ID> --secret-permissions get list --certificate-permissions get listAdd the identity to the vault access policy
Expected: Access policy updated.
Resolution runbook
Apply from top to bottom after the cause is confirmed. Review every command before running it — risk tags are shown on each.
az keyvault show --name <KV-NAME> --resource-group <RG> --query "properties.enableRbacAuthorization" -o tsvDetermine the access model
az keyvault show --name <KV-NAME> --resource-group <RG> --query "properties.accessPolicies[].objectId" -o tsvCheck current access policies
az keyvault set-policy --name <KV-NAME> --resource-group <RG> --object-id <PRINCIPAL-ID> --secret-permissions get list --certificate-permissions get listGrant access via access policy
az role assignment create --assignee-object-id <PRINCIPAL-ID> --role "Key Vault Secrets User" --scope <KV-SCOPE>Grant access via RBAC if the vault uses RBAC
Prevention
- Standardize on RBAC for Key Vault and disable legacy access policies.
- Grant least-privilege roles (Key Vault Secrets User) rather than Contributor.
- Audit Key Vault access with Azure Monitor activity log alerts.
- Use managed identity and grant roles during resource creation.
Related runbooks
Same stack, same failure family — worth a skim.
Commands marked READ CHANGE DESTRUCTIVE — never run DESTRUCTIVE commands against production data you cannot restore. Copy → verify → execute.