Home › Studies › SC-500 › Identity & Governance › Azure Key Vault

Azure Key Vault

Vaults and Managed HSM · soft delete and purge protection · Azure RBAC and access policies · firewall and Private Link · keys, secrets, certificates · Defender CSPM secrets scanning · Defender for Key Vault

By the tools4free.dev team · Last reviewed November 13, 2026

Practice questions for this topic →

Deploy a vault and configure its settings

Key Vault has two container types. Vaults store software-protected and HSM-backed keys, secrets and certificates. Managed HSM pools store only HSM-backed keys. Vaults are low-cost, multi-tenant and zone-resilient where available; Managed HSM is single-tenant and suited to high-value keys and the strictest compliance needs.

TopicRule
Vault name3 to 24 characters: letters, numbers and hyphens. Must be unique.
Create (CLI)az keyvault create --name "<vault-name>" --resource-group "myResourceGroup" --enable-rbac-authorization true --enable-purge-protection true. Microsoft calls purge protection a security best practice.
Default access modelStarting with API version 2026-02-01, Azure RBAC is the default access control model for newly created vaults.
Key typesStandard and Premium support RSA and EC keys. HSM key types need Premium. Symmetric oct-HSM (AES) keys in Premium vaults are in public preview and not recommended for production.
Key protectionVaults protect keys with FIPS 140 validated HSMs. HSM Platform 2 (FIPS 140-3 Level 3) now protects all new keys and key versions.
Vault layoutUse one vault per application, region and environment (dev, preproduction, production) to limit the blast radius. In multitenant SaaS, one vault per tenant.
Not forConfiguration data, customer content, or certificates stored as secrets. Use Azure Storage or App Configuration, Cosmos DB or Storage, and Key Vault certificates.

Soft delete and purge protection

Soft deletePurge protection
DefaultOn for new vaults; once enabled it can't be disabledNot enabled by default; optional
Prerequisite-Soft delete must be enabled first
Retention7 to 90 days, default 90. Set only at vault creation; can't be changed later. The same interval applies to purge protection.Same interval
EffectDeleted vault or object stays recoverable. Permanent deletion takes two steps: delete, then purge.A vault or object in the deleted state can't be purged until the retention period passes

Configure access to Key Vault

Access has two independent planes. The control plane manages the vault itself (create, delete, properties, tags) and uses Azure RBAC. The data plane works with keys, secrets and certificates and uses either Azure RBAC or a Key Vault access policy (legacy). Both planes authenticate with Microsoft Entra ID. Granting data access to an app is a data plane grant; a user who only needs to read vault properties and tags needs a control plane role.

Azure RBAC (recommended)Access policy (legacy)
ScopesManagement group, subscription, resource group, vault, or an individual key, secret or certificateVault level only
EntriesRole assignmentsUp to 1024 access policy entries per vault; prefer groups
PIM / JITSupported (eligible assignments)Not supported
Privilege escalationPermission management is limited to Owner and User Access AdministratorContributor (or any role with Microsoft.KeyVault/vaults/write) can grant themselves data plane access

Built-in data plane roles

RoleWhat it allows
Key Vault AdministratorAll data plane operations on the vault and its objects. Can't manage vault resources or role assignments.
Key Vault ReaderRead metadata of the vault, certificates, keys and secrets. Can't read secret contents or key material.
Key Vault Secrets Officer / Secrets UserOfficer: any action on secrets except managing permissions. User: read secret contents (including a certificate's secret with private key).
Key Vault Crypto Officer / Crypto UserOfficer: any action on keys except managing permissions. User: perform cryptographic operations with keys.
Key Vault Crypto Service Encryption UserRead key metadata and wrap/unwrap.
Key Vault Certificates Officer / Certificate UserOfficer: any action on certificates except managing permissions. User: read the entire certificate including secret and key.
Key Vault Purge OperatorPermanently delete soft-deleted vaults.
Key Vault Data Access AdministratorAdd or remove assignments of the Key Vault roles (includes an ABAC condition to constrain them).
Key Vault ContributorControl plane only. Doesn't allow access to keys, secrets or certificates.

These data plane roles work only on vaults that use the Azure RBAC permission model. ABAC conditions for Key Vault are in preview and apply only to secret data actions.

Switching the permission model

How callers authenticate

Key Vault firewall and network access

By default the Key Vault firewall is disabled: all applications and Azure services can send requests. Authentication and authorization are still required. Options, from most to least restricted, are: disable public access and use private endpoints only; enable the firewall; use a Network Security Perimeter.

OptionDetails
Firewall with IPv4 rulesPublic static IPs or CIDR ranges only: private ranges (10.x, 172.16-31.x, 192.168.x) are not allowed. IPv4 only. Max 1000 IPv4 rules.
Firewall with virtual networksEnable the Microsoft.KeyVault service endpoint on the subnet, then add the network rule. Up to 15 minutes to take effect. Max 200 virtual network rules. Use this when you can't rely on static IPs (for example VMs).
Trusted services bypassAllow trusted Microsoft services to bypass this firewall. Only services on the trusted list qualify; Azure DevOps is not on it. The trusted list covers services where Microsoft controls all the code. Services not on the list are blocked whether or not the bypass is on.
Private endpoint (Private Link)Private endpoint and virtual network must be in the same region; the vault can be in another region. Needs Owner or Contributor on the vault and the virtual network.
Disable public accessDenies all public configurations; only private endpoints work. Trusted services still bypass and need no private endpoint; other services (for example Azure DevOps) need a private endpoint.
Network Security PerimeterWith public network access set to Secure by perimeter, the trusted services bypass is overridden: even trusted services are blocked unless a perimeter rule admits them.

Keys, secrets and certificates

Keys and rotation

Secrets

Certificates

Defender CSPM secrets scanning and Defender for Key Vault

Secrets scanning typeWhat it doesPlan needed
Machine scanningAgentless secrets scanning on multicloud VMsDefender CSPM plan, or Defender for Servers Plan 2
Cloud deployment resource scanningAgentless scanning of infrastructure-as-code deployment resources across cloudsDefender CSPM plan
Code repository scanningFinds exposed secrets in Azure DevOpsDefender CSPM plan

Microsoft Defender for Key Vault

The cached Learn pages for Defender for Key Vault describe features, alerts and response, but not the plan enablement steps, so this page doesn't list them.

CLI and PowerShell

TaskAzure CLIPowerShell
Create a vault with Azure RBAC and purge protectionaz keyvault create --name "<vault-name>" --resource-group "myResourceGroup" --enable-rbac-authorization true --enable-purge-protection true-
Assign a Key Vault data plane roleaz role assignment create --role "Key Vault Secrets Officer" --assignee <user-principal-name> --scope /subscriptions/<subscription-id>/resourcegroups/<resource-group>/providers/Microsoft.KeyVault/vaults/<vault-name>New-AzRoleAssignment -RoleDefinitionName "Key Vault Secrets Officer" -SignInName <user-principal-name> -Scope "/subscriptions/<subscription-id>/resourcegroups/<resource-group>/providers/Microsoft.KeyVault/vaults/<vault-name>"
Let trusted Microsoft services bypass the firewallaz keyvault update --resource-group "myresourcegroup" --name "mykeyvault" --bypass AzureServicesUpdate-AzKeyVaultNetworkRuleSet -VaultName "mykeyvault" -Bypass AzureServices
Add an IP address ruleaz keyvault network-rule add --resource-group "myresourcegroup" --name "mykeyvault" --ip-address "191.10.18.0/24"Add-AzKeyVaultNetworkRule -VaultName "mykeyvault" -IpAddressRange "16.17.18.0/24"
Enable the Key Vault service endpoint on a subnetaz network vnet subnet update --resource-group "myresourcegroup" --vnet-name "myvnet" --name "mysubnet" --service-endpoints "Microsoft.KeyVault"-
Set the firewall default action to denyaz keyvault update --resource-group "myresourcegroup" --name "mykeyvault" --default-action DenyUpdate-AzKeyVaultNetworkRuleSet -VaultName "mykeyvault" -DefaultAction Deny
Disable public network accessaz keyvault update --resource-group "myresourcegroup" --name "mykeyvault" --public-network-access DisabledUpdate-AzKeyVault -ResourceGroupName "myresourcegroup" -VaultName "mykeyvault" -PublicNetworkAccess "Disabled"
Set a key rotation policyaz keyvault key rotation-policy update --vault-name <vault-name> --name <key-name> --value </path/to/policy.json>Set-AzKeyVaultKeyRotationPolicy -VaultName <vault-name> -KeyName <key-name> -ExpiresIn (New-TimeSpan -Days 720) -KeyRotationLifetimeAction @{Action="Rotate";TimeAfterCreate= (New-TimeSpan -Days 540)}
Rotate a key nowaz keyvault key rotate --vault-name <vault-name> --name <key-name>Invoke-AzKeyVaultKeyRotation -VaultName <vault-name> -Name <key-name>

Exam Tips

Tick each tip once you can answer it without looking.

“New vault must resist accidental or malicious permanent deletion” → Soft delete (on by default) plus purge protection (opt in). Trap: Purge protection needs soft delete first and isn't enabled by default; retention (7 to 90 days) is fixed at creation.

“Storage account encrypted with a customer-managed key in Key Vault” → Purge protection must be on. Trap: Most integrating services, such as Storage, require purge protection to prevent data loss.

“Recreate a vault with the same name right after deleting it” → Not possible until the soft-delete retention period expires (or it is purged). Trap: With purge protection even the owner can't purge early. Recovering the vault doesn't restore RBAC assignments.

“App needs to read secret values only” → Key Vault Secrets User on the vault, for the app's managed identity. Trap: Key Vault Reader reads metadata only; Secrets Officer can also write and delete.

“App needs to sign and encrypt with keys but not manage them” → Key Vault Crypto User. Trap: Crypto Officer manages keys; Crypto Service Encryption User only does wrap/unwrap and reads metadata.

“User has Key Vault Contributor but can't read secrets” → Key Vault Contributor is control plane only; assign a data plane role. Trap: Under the legacy access policy model, a Contributor can add an access policy for themselves.

“After enabling Azure RBAC, apps that worked are now denied” → Switching to Azure RBAC invalidates all access policies; assign equivalent roles. Trap: Only Owner or User Access Administrator (plus vaults/write) can switch the model; Co-Administrator can't.

“Grant one team access to many vaults at once” → Azure RBAC role at management group, subscription or resource group scope (use PIM eligible assignments). Trap: Access policies exist only at the vault level.

“Vault firewall on; a Microsoft service needs access” → Check that the service is on the trusted services list and enable Allow trusted Microsoft services to bypass this firewall. Trap: Azure DevOps isn't trusted; use a firewall rule or private endpoint instead. Secure by perimeter overrides the bypass.

“VMs with changing IPs must reach the vault through the firewall” → Subnet service endpoint Microsoft.KeyVault plus a virtual network rule. Trap: IP rules accept only public IPv4 ranges: 10.x, 172.16-31.x and 192.168.x are rejected.

“No public exposure at all; traffic only from your virtual network” → Private endpoint, then disable public network access. Trap: Trusted services still bypass when public access is disabled; the endpoint must be in the same region as the virtual network.

“Portal shows the vault but not its keys after firewall rules were added” → Your client machine isn't in the allowed networks; data plane calls are blocked. Trap: Listing vaults is control plane; listing keys is data plane.

“Automatically create a new key version every 18 months” → Key rotation policy (rotate after creation), managed by Key Vault Crypto Officer. Trap: Rotation re-wraps DEKs; it doesn't re-encrypt data, so don't disable the old version early.

“Certificate private key must not be retrievable” → Policy with a non-exportable key (HSM keys are non-exportable). Trap: If the policy marks the key exportable, the addressable secret returns the private key in PFX or PEM.

“Auto-renew a certificate” → Lifetime action autoRenew with a partner issuer (DigiCert or GlobalSign). Trap: Non-partnered CAs work but can't auto-renew; an issuer object works only in its own vault.

“Find plaintext connection strings and SSH keys on VMs and IaC deployments” → Defender CSPM secrets scanning (machine scanning also with Defender for Servers Plan 2). Trap: Code repository scanning for Azure DevOps and cloud deployment scanning need the Defender CSPM plan.

“Defender for Key Vault alert from a user you recognize” → Still investigate: verify with the owner, rotate accessed objects. Trap: It targets suspicious activity from stolen credentials; recognition isn't proof of legitimacy.

Sources

Checked against Microsoft Learn on November 13, 2026.

← Entra ID Access & App IdentityPolicy & Compliance →