What is Azure Key Vault? Manage keys, secrets, and certificates safely
Azure Key Vault is an Azure service for centrally storing application secrets, cryptographic keys, and TLS certificates while controlling access to them. Instead of putting a database password or API token in source code or a configuration file, an application can use a managed identity to read only the item it needs. This reduces the risk of credentials being copied along with code. Key Vault does not, by itself, make application permissions, network access, rotation, or recovery safe.
What is Azure Key Vault? Manage keys, secrets, and certificates safely
Azure Key Vault is an Azure service for centrally storing application secrets, cryptographic keys, and TLS certificates while controlling access to them. Instead of putting a database password or API token in source code or a configuration file, an application can use a managed identity to read only the item it needs. This reduces the risk of credentials being copied along with code. Key Vault does not, by itself, make application permissions, network access, rotation, or recovery safe.
What belongs in Key Vault?
A secret is a string such as a database connection string, API key, or password. A key is cryptographic material used for operations such as encryption, decryption, and signing; it can be configured so operations happen within Key Vault. A certificate is a digital document that binds a public key to identity information for TLS and similar uses. A certificate can include a private key, and its lifecycle can be managed.
These objects serve different purposes. Use a secret when an app needs to present a token to an external service, a key when you need to control the lifecycle of cryptographic material used to protect data, and a certificate when you manage a TLS identity and renewal. Key Vault protects stored values and key operations; it does not design application authorization or choose every encryption policy for you.
How does an application authenticate and get permission?
Authentication establishes who is making a request; authorization determines which operations that identity may perform. Key Vault uses Microsoft Entra ID for authentication. Work is divided between the control plane, which manages the vault resource, and the data plane, which operates on keys, secrets, and certificates. Do not assume that access to one plane automatically grants access to the other.
For applications and services running in Azure, a managed identity is usually the preferred option. The platform issues tokens for that identity, so the app does not need a long-lived password or service principal secret in its configuration. For local development or hosting that cannot use managed identity, use an appropriate Microsoft Entra developer credential or protected service principal; never put its credentials in code or a public repository.
Prefer Azure role-based access control (RBAC) for data-plane authorization. A role assignment combines a security principal, role, and scope, making it possible to specify who can read secrets or use keys in a vault. With the legacy access policy model, some users who can modify a vault as contributors may also add data access policies for themselves, mixing resource administration and data access. Microsoft recommends RBAC and documents it as the default permission model for new vaults starting with API version 2026-02-01. Check deployment-tool and existing-vault compatibility, then start new designs with least-privilege roles.
How should an app retrieve and use a secret?
Suppose an order service needs a database password. Keep it out of source code and container images; assign the production app's managed identity a read role for the relevant vault. At startup or when credentials need refreshing, the app can retrieve the current secret version through an Azure SDK or a supported configuration integration. After connecting, it can cache the value in memory for a limited time and retrieve it again according to rotation or expiry policy. Keep the local-development identity separate from the production identity.
This design still requires care: do not write the secret into logs, error messages, or diagnostic dumps. Ask whether an app really needs vault administrator rights or write access to every secret. Separate vaults by application, environment, or security boundary when doing so limits permissions and the impact of an incident.
How should you configure network and data protection?
Authentication does not replace network restrictions. Depending on the requirement, configure Key Vault firewall rules, trusted-service exceptions, virtual network service endpoints, or a Private Link boundary. Confirm that the application can use the intended route and DNS. Overly narrow rules can block legitimate calls, so validate deployment and recovery paths as well.
Plan for deletion recovery. Soft delete keeps a deleted vault or object recoverable for a retention period. Purge protection prevents permanent deletion (purging) before that period ends, limiting accidental or malicious irreversible loss. Recoverable deletion and permanent deletion are different. Because vault names are globally unique, a soft-deleted vault can prevent immediate reuse of its name; with purge protection enabled, the name may remain unavailable until retention expires. These features help recovery but do not replace backup and disaster-recovery planning.
How do you manage rotation of keys, secrets, and certificates?
Rotation creates a new credential or key version, moves the applications and dependent services to it, and then retires the old version. Document whether the app pins a specific version or requests the latest one, and verify that connections refresh when a new version is deployed. An automatic rotation feature does not necessarily reauthenticate every consumer, rebuild its connection pool, or retire the old version for you.
For certificates, monitor renewal events before expiry and record who owns issuance and renewal. For encryption keys, determine whether data must be re-encrypted and how long older material is needed to read existing data. A rotation procedure should include a safe transition, rollback to the previous version if needed, and a way to confirm completion.
How should you handle audit and high request volume?
Enable Key Vault diagnostic logs to review who attempted which operation and whether it succeeded. Send logs to Log Analytics, Storage, or another supported destination, and alert on events such as denied access, unusual reads, deletions, and permission changes. Protect the log destination and set its retention period. Logs are not a place to store plaintext secrets, so the application should also avoid recording sensitive values.
Key Vault provides a resilient API, but it should not be treated as an unlimited, high-throughput database. Excessive requests can receive HTTP 429 throttling responses. Use exponential backoff instead of immediate repeated retries, cap retry attempts, and safely cache successfully retrieved secrets in memory. If many instances read the same value at once, consider having one component retrieve it and distribute it securely. Separate vaults by region or security boundary when that helps divide traffic and permissions, while accounting for the added operational complexity.
When should you consider Managed HSM instead?
Key Vault is a suitable starting point for ordinary application secrets, keys, and certificate lifecycles. Evaluate Azure Key Vault Managed HSM when you require dedicated HSM instances, higher throughput for large-scale key operations, a separate administrative boundary, or specific compliance requirements. Managed HSM is not simply a “more secure Key Vault” switch. Compare key types, operation volume, cost, management responsibilities, availability, and disaster-recovery requirements in current official documentation.
What is a safe implementation order?
First identify whether each item is a secret, key, or certificate, and list the applications and environments that consume it. Create vaults around application and environment boundaries. Configure Microsoft Entra authentication and a managed identity for the app. Start data-plane permissions with RBAC and least-privilege roles, then apply network restrictions. Confirm soft delete and purge protection. Add a test secret or nonproduction key and verify the app's read and refresh path. Finally, configure audit logs and alerts, name rotation owners, document recovery, and check retry behavior for throttling and denied access. During a production-credential validation, never display the secret in a screen or log.
References
[Microsoft Learn: Azure Key Vault overview](https://learn.microsoft.com/en-us/azure/key-vault/general/overview)
[Microsoft Learn: Azure RBAC versus access policies](https://learn.microsoft.com/en-us/azure/key-vault/general/rbac-access-policy)
[Microsoft Learn: Secure your Azure Key Vault](https://learn.microsoft.com/en-us/azure/key-vault/general/secure-key-vault)
[Microsoft Learn: Soft-delete and purge-protection recovery](https://learn.microsoft.com/en-us/azure/key-vault/general/key-vault-recovery)
[Microsoft Learn: Manage application API keys as Key Vault secrets](https://learn.microsoft.com/en-us/azure/key-vault/general/apps-api-keys-secrets)
[Microsoft Learn: Key Vault logging](https://learn.microsoft.com/en-us/azure/key-vault/general/logging)
[Microsoft Learn: Key Vault throttling guidance](https://learn.microsoft.com/en-us/azure/key-vault/general/overview-throttling)
[Microsoft Learn: Key Vault service limits](https://learn.microsoft.com/en-us/azure/key-vault/general/service-limits)
Microsoft Learn documentation was reviewed on November 20, 2026. Permission-model defaults, service limits, regional availability, and prices can change; check the latest documentation for the target region and API version before deployment.