Pcornel
Browse topics
Options
Recent
Favorites
Cloud · Technical reference

Azure Key Vault

Direct answer

Azure Key Vault stores secrets (passwords, connection strings), cryptographic keys and certificates, and controls who can read or use them. Access is authorized with Azure RBAC (recommended; the default for vaults created with API version 2026-02-01 or later) or legacy vault access policies.

When to use this

Use it to keep secrets out of code and configuration, to give applications access through managed identities, and to keep keys under audited control.

First 30 seconds

1. Which identity calls the vault (user, managed identity, service principal)?

2. Which permission model, and does that identity hold the right data-plane role/policy?

3. Is the request allowed by the vault firewall or reaching it through the private endpoint?

4. Is the item enabled, unexpired and not soft-deleted?

Operational verification

caller identity → Entra ID token → vault network rules / private endpoint → authorization (RBAC role or access policy) → object state (enabled, expiry, deleted) → operation

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Azure Key Vault (standard and premium). Managed HSM is a separate service.
Applicability is projected only from persisted Topic profile and Command metadata.
At a glance

Operational reference

Fast context before you go deeper.

PlatformAzure Key Vault (standard and premium). Managed HSM is a separate service.
Key commandaz role assignment list --scope $(az keyvault show -n $KV --query id -o tsv) \
Scope / prerequisiteUse it to keep secrets out of code and configuration, to give applications access through managed identities, and to ke…
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Read-only Verification Verify boundary
KV=kv-app-prod

# Model, recovery and network posture
az keyvault show -n $KV --query "{rbac:properties.enableRbacAuthorization, softDelete:properties.enableSoftDelete, retention:properties.softDeleteRetentionInDays, purgeProtection:properties.enablePurgeProtection, publicAccess:properties.publicNetworkAccess, defaultAction:properties.networkAcls.defaultAction}"

# Who holds data-plane roles on this vault
az role assignment list --scope $(az keyvault show -n $KV --query id -o tsv) \
  --query "[].{who:principalName, type:principalType, role:roleDefinitionName}" -o table

# Metadata only (does not print values)
az keyvault secret list --vault-name $KV --query "[].{name:name, enabled:attributes.enabled, expires:attributes.expires}" -o table

# Soft-deleted vaults still holding a name
az keyvault list-deleted --query "[].{name:name, deleted:properties.deletionDate, purge:properties.scheduledPurgeDate}" -o table

# Private endpoint name resolution from inside the VNet
nslookup $KV.vault.azure.net
Step 2 Common mistakes Narrow the fault
  • Giving people Key Vault Administrator when Secrets User is enough.
  • Storing service principal secrets in app settings to read Key Vault instead of using a managed identity.
  • Enabling purge protection on a test vault and being unable to free the name for up to 90 days.
  • Switching to RBAC without first creating role assignments.
  • Public network access enabled on production vaults because the private endpoint DNS was never linked.
Step 3 Troubleshooting Narrow the fault

Forbidden / ForbiddenByRbac. The caller lacks a data-plane role (RBAC model) or an access policy (legacy model). Check which identity the application really uses — a system-assigned identity changes if the resource is recreated.

ForbiddenByFirewall / connection refused from a VM. The request came from a non-allowed network. Check private endpoint DNS resolution and the vault's network rules.

"Vault name already in use". A soft-deleted vault with that name exists: recover it (az keyvault recover) or, if purge protection is off, purge it after confirming nothing needs it.

Application broke after a migration to RBAC. Access policies stopped applying at the switch; add the missing role assignments.

Certificate renewal failed. Check the issuer configuration and the certificate's policy; diagnostic logs (AuditEvent) show the failing operation and caller.

Key points

Control plane (manage the vault) and data plane (read a secret, use a key) are authorized separately. Soft delete is always on and keeps deleted items recoverable for 7–90 days (90 by default, fixed at creation). Purge protection, once enabled, can never be disabled.

Key checks
  • az keyvault show -n <vault> — permission model, soft delete, purge protection, network rules.
  • az role assignment list --scope <vault-id> — who has data-plane roles.
  • az keyvault secret list --vault-name <vault> — can this identity list secrets?
  • az keyvault list-deleted — soft-deleted vaults holding a name.
ReferenceWhat it is2 sections · depth on demand

Direct Answer

Azure Key Vault holds three kinds of objects: secrets (any value up to a size limit — passwords, connection strings), keys (RSA/EC keys used for encrypt, sign, wrap — the key material never leaves the vault) and certificates (with optional automatic renewal from integrated CAs).

Access has two layers: the control plane (create the vault, change its settings — Azure Resource Manager RBAC) and the data plane (get a secret, use a key). Data-plane access is granted with Azure RBAC roles such as Key Vault Secrets User, or with legacy vault access policies. Microsoft recommends Azure RBAC, and it is the default for vaults created with API version 2026-02-01 or later.

Applications should reach the vault with a managed identity, so no credential is needed to fetch the credentials.

ReferenceImportant terms & boundaries1 section · depth on demand

In depth

Permission models

Azure RBAC (recommended)Vault access policy (legacy)
Where definedRole assignments at management group, subscription, resource group, vault or single objectA list on the vault
GranularityBuilt-in roles per object type; object-level scope possiblePer object type (secrets/keys/certificates) per principal
Audit/manageSame tools as all Azure RBAC; PIM eligibleVault-specific

Key built-in data-plane roles: Key Vault Administrator (all data-plane operations), Key Vault Secrets Officer (manage secrets), Key Vault Secrets User (read secret values), Key Vault Crypto User (use keys), Key Vault Certificates Officer, Key Vault Reader (metadata only, no secret values). Key Vault Contributor is control-plane only and grants no access to secrets — but under the access-policy model, anyone who can write the vault resource can add themselves a policy, so Contributor must be tightly controlled there.

Switching an existing vault from access policies to RBAC invalidates all access policies at once; create equivalent role assignments first.

Recovery

  • Soft delete is on by default and cannot be turned off once enabled. Deleted vaults and objects stay recoverable for the retention period: 7–90 days, default 90, chosen when the vault is created.
  • A soft-deleted vault still reserves its name; creating a vault with the same name fails until it is recovered or purged.
  • Purge protection (optional) blocks permanent deletion until the retention period ends. Once enabled it cannot be disabled by anyone, including Microsoft — enable it for vaults whose keys protect data (disk or storage encryption with customer-managed keys).

Network access: the vault firewall can allow selected networks/IPs; production vaults are usually reached through a private endpoint with the privatelink.vaultcore.azure.net private DNS zone, with public access disabled.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
key vaultazure key vaultakvsoft deletepurge protectionkey vault rbackey vault access policy
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

az keyvault show: rbac: true means role assignments decide data-plane access and access policies are ignored; false means the access policy list decides. purgeProtection: null or false means it was never enabled. defaultAction: Deny with publicAccess: Disabled means only private endpoints (and trusted services if allowed) can reach it.

Role assignments: a principal with only Key Vault Contributor or Reader cannot read secret values — this explains Forbidden on secret show for admins who "own" the vault.

secret list: enabled: false or an expires date in the past means the application will be refused even with correct permissions.

nslookup from inside the VNet should return a private IP via privatelink.vaultcore.azure.net. A public IP means the private DNS zone is not linked to that VNet or the client uses another resolver; the vault firewall will then reject the call.

Design & tradeoffs

Design decisions

One vault per application per environment keeps blast radius and permissions small; shared vaults collect broad role assignments over time.

RBAC over access policies for new vaults: central audit, PIM eligibility and management-group inheritance; assign roles at vault scope and avoid per-object assignments except for special cases.

Purge protection for any vault holding keys used for encryption at rest; without it, an attacker or mistake can destroy the key and with it the data.

Private endpoint + disabled public access for production, with diagnostics (AuditEvent) sent to the central workspace and alerts on unusual access or failed authorization.

Confirmation

Confirm action

Continue?