Study guide

9.2 Azure Key Vault Deep Dive & Secrets Lifecycle

Microsoft Azure Security Technologies AZ-500

Track your progress as you read

Finished sections get a check mark.

1 Chapter 1: Exam Overview & Azure Security Architecture Foundation

1.1 Azure Security Engineer Role & Exam Logistics 1.2 Microsoft Cybersecurity Reference Architecture & Zero Trust Principles

2 Chapter 2: Secure Identity and Access - Authentication, MFA & PIM

2.1 Microsoft Entra ID Security, Users, and Groups 2.2 Authentication Methods, MFA, and Conditional Access Policy Design 2.3 Microsoft Entra Privileged Identity Management (PIM)

3 Chapter 3: Secure Identity and Access - RBAC & Workload Identity

3.1 Azure RBAC, Custom Roles, and Governance 3.2 Workload Identities and Managed Identities 3.3 External Identities and Cross-Tenant Collaboration

4 Chapter 4: Microsoft Entra Application Access & Consent Governance

4.1 Enterprise Applications, OAuth Permission Grants & Consent Governance 4.2 App Registrations, Permission Scopes & Service Principal Credentials

5 Chapter 5: Secure Azure Networking - Boundary & Perimeter Protection

5.1 Virtual Network Security & Micro-segmentation 5.2 Azure Firewall and Firewall Manager 5.3 Web Application Firewall (WAF) & Azure Front Door

6 Chapter 6: Secure Azure Networking - Private Access & Monitoring

6.1 Private Connectivity with Private Endpoints & Private Link 6.2 Azure Bastion & Remote Management Security 6.3 Network Perimeter Protection & Flow Monitoring

7 Chapter 7: Network Architecture, Routing & Hybrid Connectivity

7.1 Azure Virtual Network Manager, Network Groups & User-Defined Routes 7.2 VPN Gateway, ExpressRoute Encryption & Virtual WAN Secured Hub 7.3 Network Integration for App Service, Functions, App Service Environment & SQL Managed Instance

8 Chapter 8: Public and Edge Access Protection

8.1 Azure Application Gateway Security, TLS Policy & Mutual Authentication 8.2 Azure Front Door, CDN Caching & TLS for App Service and API Management

9 Chapter 9: Compute, Container & Registry Security

9.1 Azure Virtual Machine Hardening & Host Security 9.2 Azure Key Vault Deep Dive & Secrets Lifecycle 9.3 Container & Azure Kubernetes Service (AKS) Security 9.4 Azure Container Instances, Container Apps & Registry Access Control

10 Chapter 10: Storage Security, Access Methods & Data Protection

10.1 Storage Account Security & Access Controls 10.2 Selecting and Configuring Access to Azure Files 10.3 Selecting and Configuring Access to Azure Blob Storage 10.4 Storage Data Protection: Soft Delete, Versioning, Point-in-Time Restore & Backup

11 Chapter 11: Data Platform & Database Security

11.1 Azure SQL Database Security & Always Encrypted 11.2 Database Auditing & Vulnerability Assessment 11.3 Data Discovery, Classification, & Microsoft Purview Integration

12 Chapter 12: Cloud Governance, Key Lifecycle & Asset Protection

12.1 Azure Policy for Security Governance: Definitions, Initiatives, Effects & Remediation 12.2 Key Vault Backup, Recovery & Automated Key Rotation 12.3 Implementing Security Controls to Protect Backups 12.4 Security Controls for Asset Management: Locks, Tags, Resource Graph & Azure Arc

13 Chapter 13: Microsoft Defender for Cloud - Posture & Workload Protection

13.1 Microsoft Defender for Cloud & Secure Score 13.2 Defender Cloud Workload Protection (CWP) Plans 13.3 Defender for Cloud Inventory, Compliance Standards & Custom Standards 13.4 Connecting AWS and GCP Environments to Microsoft Defender for Cloud

14 Chapter 14: External Attack Surface & Vulnerability Management

14.1 Microsoft Defender External Attack Surface Management (EASM) 14.2 Agentless Scanning & Microsoft Defender Vulnerability Management for Azure VMs 14.3 Defender for Cloud DevOps Security: GitHub, Azure DevOps & GitLab

15 Chapter 15: Security Monitoring, Microsoft Sentinel & Automation

15.1 Azure Monitor Data Collection Rules & Network Security Event Monitoring 15.2 Microsoft Sentinel Data Connectors, Content Hub & Normalization 15.3 Microsoft Sentinel Workspace & KQL Threat Hunting 15.4 Sentinel Incident Management & SOAR Automation

9.2 Azure Key Vault Deep Dive & Secrets Lifecycle

Key Takeaways Explain This Topic AI

Azure Key Vault safeguards three distinct object types: Secrets (octets/strings up to 25KB), Keys (cryptographic RSA/EC keys for crypto operations), and Certificates (X.509 lifecycle management).

Access permissions can be governed via legacy Key Vault Access Policies (vault-level granular permissions per object type) or Azure RBAC for Key Vault (fine-grained data plane roles assigned at subscription, vault, or item level).

Soft-Delete (configurable 7–90 day retention) and Purge Protection safeguard vault objects from accidental or malicious permanent deletion. Purge Protection cannot be disabled once enabled.

Key Vault Standard provides software-protected keys (FIPS 140-2 Level 2), Premium provides multi-tenant HSM-protected keys (FIPS 140-2 Level 3), and Managed HSM provides dedicated single-tenant FIPS 140-2 Level 3 clusters.

Automated secret rotation is implemented by connecting Key Vault Event Grid system topics (publishing SecretNearExpiry events) to Azure Functions that update target services and record new secret versions.

Last updated: August 2026

6.2 Azure Key Vault Deep Dive & Secrets Lifecycle

Azure Key Vault serves as the central cryptographic repository for securing application secrets, encryption keys, and TLS certificates across Azure services. Removing hardcoded credentials, connection strings, and certificates from application code is a fundamental requirement of cloud security. Mastering Key Vault requires a granular understanding of its object types, data plane access models, network boundaries, lifecycle protections, and automated rotation patterns.

Key Vault Object Types: Secrets, Keys & Certificates

Azure Key Vault manages three primary object categories, each designed for specific cryptographic and operational use cases: +-----------------------------------------------------------------------------------+

  • | KEY VAULT OBJECT TYPES |
  • +--------------------------+--------------------------+-----------------------------+
  • | SECRETS | KEYS | CERTIFICATES |
  • | Octet strings up to 25KB | RSA / EC Cryptographic | X.509 PKI Lifecycle |
  • | Passwords, connection | Data encryption, signing | Integrated CAs & auto- |
  • | strings, PFX blobs. | Key wrapping in HSM. | renewal automation. |
  • +--------------------------+--------------------------+-----------------------------+
  • 1. Secrets

Secrets are arbitrary sequence byte arrays or UTF-8 string values up to 25 KB in size. Common examples include database connection strings, API tokens, passwords, and private SSH keys. Secrets are stored securely in Key Vault and returned in plaintext to authenticated applications over HTTPS TLS 1.2+ endpoints.

2. Cryptographic Keys

Keys are RSA or Elliptic Curve (EC) cryptographic key pairs used for encryption, decryption, digital signatures, and key wrapping operations (such as wrapping storage account keys). Crucial Design Rule: Cryptographic operations using Key Vault Keys take place inside the Key Vault service boundary. The private key material never leaves the Key Vault vault or HSM hardware.

3. Certificates

Certificates simplify the management, deployment, and renewal of X.509 public key certificates. Key Vault can generate self-signed certificates, integrate with partner Certificate Authorities (DigiCert, GlobalSign) for automated issuance, or import externally generated PFX certificates.

Access Control Models: Vault Access Policies vs. Azure RBAC

Azure Key Vault separates operations into two distinct administrative layers:

Management Plane: Managed via Azure Resource Manager (ARM). Controls vault creation, deletion, tag management, and ARM access ( Microsoft.KeyVault/vaults/* ).

Data Plane: Controls access to the actual secrets, keys, and certificates stored inside the vault.

Azure Key Vault supports two distinct authorization models for Data Plane operations:

Comparison Dimension Key Vault Access Policies (Legacy) Azure RBAC for Key Vault (Recommended)

Permission Granularity Vault-level only (all objects of a type) Subscription, Resource Group, Vault, or Individual Item

  • Role Delegation Requires Key Vault Contributor ARM role Native Azure RBAC delegation model
  • Privileged Access (PIM) Not supported for data plane Supported via Entra ID PIM eligible assignments
  • Evaluation Engine Custom Key Vault authorization engine Centralized Azure ARM Policy & RBAC engine
  • Built-in Data Roles None (manual permission checklists) Key Vault Administrator, Secrets User, Crypto Officer
  • Key Vault Access Policies (Legacy Model)

Access Policies grant permissions grouped by object type (Key Permissions, Secret Permissions, Certificate Permissions) to security principals (users, groups, or managed identities). Major Constraint: Access Policies apply globally at the vault level. If a principal is granted Secret Get permission via an Access Policy, they can read every secret within that entire vault.

Azure RBAC for Key Vault (Recommended Model)

Azure RBAC for Key Vault integrates Data Plane access into standard Azure Role-Based Access Control. This enables granular role assignments at fine scopes—down to an individual secret, key, or certificate :

Key Vault Administrator: Full management of vault data plane objects and RBAC assignments.

Key Vault Secrets Officer: Read, write, and delete secret contents.

Key Vault Secrets User: Read secret contents only ( Get / List ).

Key Vault Crypto Officer: Create, rotate, and execute cryptographic key operations.

Key Vault Crypto User: Perform cryptographic operations (Encrypt/Decrypt/Wrap) using keys.

Network Isolation: Private Endpoints & Service Firewalls

By default, Key Vault exposes a public HTTPS FQDN ( <vault-name>.vault.azure.net ). To prevent unauthorized network exposure, security engineers must enforce network isolation:

Disable Public Access: Set publicNetworkAccess = "Disabled" on the vault resource.

Virtual Network Service Firewalls: Restrict inbound traffic to specific public IP CIDR ranges or delegated VNet subnets using Virtual Network Service Endpoints.

Azure Private Link (Private Endpoints): Assign a dedicated private IP address from a VNet subnet to Key Vault. All application traffic travels over internal Azure backbone routes. Private Endpoint resolution requires a Private DNS Zone named privatelink.vaultcore.azure.net linked to the application VNet.

Soft-Delete & Purge Protection Lifecycle

Accidental or malicious deletion of encryption keys or database secrets can cause catastrophic system outages or permanent data loss. Key Vault includes two essential lifecycle safety features: +-----------------------------------------------------------------------------------+

  • | KEY VAULT DELETION LIFECYCLE |
  • +-----------------------------------------------------------------------------------+
  • | Active Vault Object ---> [Delete Executed] ---> Soft-Deleted Retention State |
  • | (Configured for 7-90 Days) |
  • | | |
  • | +-----------------------------------------------------------+ |
  • | | | |
  • | v v |
  • | [Purge Protection DISABLED] [Purge Protection ENABLED] |
  • | Authorized admin can immediately Purge command rejected by |
  • | purge & permanently destroy item. service! Item MUST expire. |
  • +-----------------------------------------------------------------------------------+
  • Soft-Delete

Soft-Delete retains deleted vaults, secrets, keys, and certificates for a configurable retention period between 7 and 90 days (default: 90 days). While in the soft-deleted state:

The object cannot be recreated using the same name.

The object can be fully restored ( recover ) back to an active state with its history intact.

Soft-Delete is mandatory and permanently enabled on all Azure Key Vaults.

Purge Protection

Under basic Soft-Delete, a privileged identity with Purge permissions can manually bypass the retention timer and permanently delete objects. Purge Protection blocks manual purging during the retention window:

Once Purge Protection is enabled on a Key Vault, it cannot be disabled by any user, Global Administrator, or Microsoft Support.

Soft-deleted items must remain in the retention buffer until the retention timer fully expires.

This protects against ransomware, insider threats, and compromised administrative accounts attempting to destroy master encryption keys.

Hardware Security Modules (HSM) Tier Comparison

Azure offers three distinct architectural tiers for Key Vault based on security compliance requirements:

Standard Tier: Software-protected keys backed by multi-tenant cryptographic modules validated to FIPS 140-2 Level 2 .

Premium Tier: Supports HSM-protected keys (Hardware Security Modules) processed in multi-tenant HSM hardware validated to FIPS 140-2 Level 3 .

Azure Key Vault Managed HSM: A fully managed, dedicated (single-tenant), highly available FIPS 140-2 Level 3 HSM cluster. Provides complete customer domain control, Local RBAC data plane governance, and confidential key isolation.

Automated Secret Rotation Architecture

Rotating credentials regularly minimizes exposure windows. Native Key Vault integration with Azure Event Grid enables event-driven automated secret rotation.

Event-Driven Secret Rotation Flow

Expiry Configuration: Secret or key objects are configured with an Expiration Date ( exp ).

Event Grid Notification: As the secret approaches expiration, Key Vault publishes a Microsoft.KeyVault.SecretNearExpiry event to an Azure Event Grid System Topic.

Automation Execution: Event Grid triggers an Azure Function (or Azure Automation Runbook).

Credential Update: The Azure Function connects to the target service (e.g., Azure SQL Database), generates a new random password, updates the database account, and writes the new secret version into Key Vault.

Loading diagram... Automated Key Vault Secret Rotation via Event Grid and Azure Function