Key vaults should have deletion protection enabled
Facts read 10 Nov 2026. Page reviewed 16 Nov 2026.
Key vaults should have deletion protection enabled is an Azure guardrail written in Azure Policy. Denies key vaults without purge protection and soft delete enabled, so keys and secrets cannot be purged during the retention period. Copied from a licensed open source set and read on 10 Nov 2026.
More encryption and keys guardrails ยท About Azure Policy
Built-in policy definition: Key vaults should have deletion protection enabled
Definition ID: 0b60c0b2-2dc2-4e1c-b5c9-abbed971de53
Category: Key Vault
Supported effects: Audit, Deny, Disabled
policyRule (copied from the repository file):
{
"if": {
"allOf": [
{
"field": "type",
"equals": "Microsoft.KeyVault/vaults"
},
{
"field": "Microsoft.KeyVault/vaults/createMode",
"notEquals": "recover"
},
{
"anyOf": [
{
"allOf": [
{
"value": "[requestContext().apiVersion]",
"less": "2019-09-01"
},
{
"anyOf": [
{
"field": "Microsoft.KeyVault/vaults/enableSoftDelete",
"equals": "false"
},
{
"field": "Microsoft.KeyVault/vaults/enableSoftDelete",
"exists": "false"
}
]
}
]
},
{
"allOf": [
{
"value": "[requestContext().apiVersion]",
"greaterOrEquals": "2019-09-01"
},
{
"field": "Microsoft.KeyVault/vaults/enableSoftDelete",
"equals": "false"
}
]
},
{
"field": "Microsoft.KeyVault/vaults/enablePurgeProtection",
"exists": "false"
},
{
"field": "Microsoft.KeyVault/vaults/enablePurgeProtection",
"equals": "false"
}
]
}
]
},
"then": {
"effect": "[parameters('effect')]"
}
}
- Blocks
- Denies key vaults without purge protection and soft delete enabled, so keys and secrets cannot be purged during the retention period.
- Breaks
- Purge protection enforces a mandatory retention period: no one in your organization or Microsoft can purge the vault during the soft delete retention period. (source)
- Test before applying
- As for every Azure Policy guardrail: how to test before enforcing
- Mechanism
- Azure Policy (built-in definitions): Resources at the scope of the assignment (management group, subscription, resource group) and their children, except notScopes and exemptions
- Taken from
- open source set, MIT License, Azure/azure-policy repository, https://raw.githubusercontent.com/Azure/azure-policy/master/LICENSE
What the source says
"Malicious deletion of a key vault can lead to permanent data loss." (read 10 Nov 2026).
On what it breaks: "No one inside your organization or Microsoft will be able to purge your key vaults during the soft delete retention period."
Related guardrails
- Deny KMS key deletionAWS, Service control policies (SCPs), encryption and keys
- Enforce a 30-day KMS key deletion windowAWS, Service control policies (SCPs), encryption and keys
- Deny disabling default EBS encryptionAWS, Service control policies (SCPs), encryption and keys
- Storage accounts should have the specified minimum TLS versionAzure, Azure Policy (built-in definitions), encryption and keys
- OS and data disks should be encrypted with a customer-managed keyAzure, Azure Policy (built-in definitions), encryption and keys
Related pages
Sources
- Key vaults should have deletion protection enabled, read 10 Nov 2026
- How to test it first, read 10 Nov 2026
Last reviewed 16 Nov 2026.