SecretsAzure
Azure Key Vault: access control, private access and rotation
Access to a key vault has two parts: who may read a secret, and which networks a request may come from. Azure RBAC controls the first. The Key Vault firewall and private endpoints control the second.

Azure RBAC or access policies
Key Vault offers two authorization systems for its data plane. The access policy model is a legacy system, native to Key Vault, that assigns permissions to security principals at Key Vault scope. Azure RBAC uses role assignments. Microsoft recommends Azure RBAC.
The difference Microsoft stresses is who can grant access:
- Under access policies, data plane access is something a user can grant to themselves if they hold
Contributor,Key Vault Contributoror any other role withMicrosoft.KeyVault/vaults/write. - Under Azure RBAC, only a member of the Owner or User Access Administrator role can grant access to keys, secrets and certificates.
New key vaults created through API version 2026-02-01 or later use Azure RBAC as their access control model by default. The default applies only to create operations, and existing vaults keep their current model. To use access policies for a new vault, set enableRbacAuthorization to false at creation time.
Microsoft retires every Key Vault control plane API version older than 2026-02-01 on February 27, 2027. Microsoft says to upgrade to Azure CLI 2.90.0 or later, which supports the new API version.
Setting the Azure RBAC permission model on an existing vault invalidates all access policy permissions, which can cause outages when equivalent Azure roles are not assigned.
The built-in roles
Key Vault Secrets Userreads secret contents.Key Vault Secrets Officermay do anything with a key vault's secrets apart from managing permissions.Key Vault Crypto Userperforms cryptographic operations using keys, andKey Vault Crypto Officerperforms any action on keys, except managing permissions.Key Vault Certificate Userreads entire certificate contents, andKey Vault Certificates Officerperforms any action on certificates, except managing permissions.Key Vault Readerreads metadata and cannot read sensitive values.Key Vault Administratorperforms all data plane operations and cannot manage role assignments.Key Vault Contributoris for control plane operations only. Keys, secrets and certificates stay out of its reach.
VAULT_ID="/subscriptions/<subscription-id>/resourceGroups/<resource-group>"
VAULT_ID="$VAULT_ID/providers/Microsoft.KeyVault/vaults/<vault-name>"
az role assignment create --role "Key Vault Secrets User" \
--assignee <object-id> --scope "$VAULT_ID"--assignee accepts an object ID, a user sign-in name or a service principal name. Microsoft does not recommend assigning roles on individual keys, secrets and certificates.
The firewall and private endpoints
A newly created key vault has its firewall turned off by default. Any application or Azure service can then send requests to the vault, and each request still needs Microsoft Entra authentication and permissions.
az keyvault update --resource-group <resource-group> --name <vault-name> --default-action Deny
az keyvault update --resource-group <resource-group> --name <vault-name> \
--public-network-access Disabled- Default action Deny. With firewall rules in effect, a data plane operation succeeds only if the request comes from an allowed virtual network or an allowed IPv4 address range.
- Public access disabled. The vault is then accessible only through private endpoints. Microsoft says to ensure your private endpoint configuration is complete before you disable public access.
- Trusted services.
--bypass AzureServiceslets trusted Microsoft services bypass the firewall. The trusted services list does not cover every Azure service. Azure DevOps is not on it. - Data plane only. Key Vault firewall rules apply only to data plane operations. Control plane operations are not subject to them.
Soft delete and purge protection
When you create a new key vault, soft delete is on by default. Once it is enabled, it cannot be disabled. A deleted vault, key, secret or certificate remains recoverable for a period of 7 to 90 days, and 90 days is the default. The interval can only be configured during key vault creation.
Purge protection is not enabled by default. While it is on, nothing in the deleted state, vault or object, can be purged before the retention period ends. The Azure CLI help states that enabling it is irreversible. Microsoft recommends purge protection when using keys for encryption, and says most Azure services that integrate with Key Vault, such as Storage, require it.
az keyvault create --resource-group <resource-group> --name <vault-name> \
--location <location> --enable-rbac-authorization true \
--enable-purge-protection true --retention-days 90When a vault is soft-deleted, its Azure RBAC role assignments and Event Grid subscriptions are deleted. Recovering the vault does not restore them.
Rotation
- Keys. A rotation policy automatically generates new key versions at the frequency you specify. The minimum rotation interval is seven days.
- Secrets. Autorotation of a secret is set up with an Azure Function that an Event Grid event triggers. Microsoft documents two scenarios: resources with one set of authentication credentials, and resources with two sets.
One vault per application and environment
Microsoft recommends one vault for each application in each environment (Development, Pre-Production and Production) and role assignments made at the scope of the key vault.
Its RBAC guide says role assignments on individual objects do not isolate application teams inside one vault. Administrative operations such as network access control and monitoring require vault-level permissions.
What to check on an existing vault
- Check the permission model with
az keyvault show, and look at theenableRbacAuthorizationproperty. - Review who holds Owner or User Access Administrator, the roles that can grant access.
- Confirm that public network access is disabled, or that the default action is
Deny. - Confirm that purge protection is on.
- Set
enableRbacAuthorizationexplicitly in templates that create vaults, and move them to API version 2026-02-01 or later before February 27, 2027.
Sources
- Azure role-based access control (Azure RBAC) vs. access policies
- Grant permission to applications to access an Azure key vault using Azure RBAC
- Plan for Azure RBAC as the default access control model in Key Vault
- Configure network security for Azure Key Vault
- Azure Key Vault soft-delete
- Understanding autorotation in Azure Key Vault
Want a second pair of eyes on yours? We do this work for a living.
More guides

Set up OIDC between GitHub Actions and Azure
Authentication · 2 min read
Five steps from an app registration to a workflow that logs in with no stored secret.

AWS Secrets Manager or Parameter Store
Secrets · 4 min read
Rotation, cross-account access, size limits and cost decide which AWS service holds a given value.

Kubernetes Secrets: encryption at rest and who can read them
Security · 4 min read
How Secrets are stored, how to encrypt them in etcd, and who can still read them.