Azure Key Vault — Secrets, Keys & Certificates
Securely manage secrets, encryption keys, and SSL certificates in Azure Key Vault.
“Welcome back. Today we're tackling one of the most important security topics for Azure developers — secrets management with Azure Key Vault. How many times have you seen database passwords or API keys hardcoded in source code, or stored in plain text config files? Key Vault is the solution. It's a cloud-hosted, hardware-backed vault for all your sensitive configuration data.”
“The problem is widespread — credentials in source code, passwords in config files, API keys in environment variables. Every one of these is a potential breach. Git repos are often shared or accidentally made public, and git history never forgets. Key Vault solves this by being the single secure location for all sensitive values. Every access is logged, secrets can be rotated without touching your application code, and access is controlled through Azure RBAC.”
“Key Vault stores three types of objects. Secrets are the most common — any sensitive string value like a database password or API key. Keys are cryptographic keys used for encryption and signing operations — your application can ask Key Vault to encrypt or decrypt data without the key ever leaving the vault. Certificates are SSL/TLS certificates, and Key Vault can automatically renew them from Let's Encrypt or DigiCert before they expire. Never miss a certificate renewal again.”
“The elegant solution to accessing Key Vault from your applications is Managed Identity. Enable a Managed Identity for your App Service or Function App, then grant that identity the Secret Reader role on your Key Vault. In your application code, you request an access token from the local Azure endpoint — no credentials required. Azure handles authentication behind the scenes. Your application accesses secrets securely with zero credentials anywhere in your codebase.”
“App Service has a beautiful integration with Key Vault called Key Vault References. Instead of putting your database password directly in an App Setting, you put a reference to a Key Vault secret. App Service automatically fetches the actual value at runtime using its Managed Identity. When you rotate a secret in Key Vault, App Service picks up the new value automatically. Your application code still reads a normal environment variable — it never knows the difference. This is the cleanest way to handle secrets in web applications.”
“Key Vault offers two access control models. The newer RBAC model integrates with the rest of Azure's permission system — you assign roles like Key Vault Secrets User to specific identities at specific scopes. The legacy Access Policy model sets permissions directly on the vault. Use RBAC for new vaults — it provides a unified, auditable access control story. Always grant minimum permissions: an application that only needs to read secrets should get the Secrets User role, not administrator.”
“Let's see this in action. I'll create a Key Vault, add a database connection string as a secret, enable a Managed Identity on an App Service, grant that identity access to read secrets, and then configure a Key Vault Reference in the App Settings. The application will read the connection string as a normal environment variable, but it's actually being fetched securely from Key Vault in real time.”
“Azure Key Vault is a non-negotiable part of any secure Azure architecture. If you take one thing from this video, it's this: never put secrets in code. Always use Key Vault. Next video we cover observability — Azure Monitor and Application Insights. You've deployed your app, secured it, now how do you know it's working? How do you find problems before users do? That's what monitoring is for.”
- 1Create a Key Vault
- 2Add a secret (database connection string)
- 3Access the secret via Azure Portal
- 4Create a Managed Identity for an App Service
- 5Grant App Service 'Secret Reader' access to Key Vault
- 6Reference Key Vault secret in App Service App Settings
- 7Show access logs in Key Vault diagnostics