# 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.

```text
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](https://raw.githubusercontent.com/Azure/azure-policy/master/built-in-policies/policyDefinitions/Key%20Vault/Recoverable_Audit.json))
- **Test before applying:** As for every Azure Policy guardrail: [how to test before enforcing](/mechanisms/azure-policy/)
- **Mechanism:** [Azure Policy (built-in definitions)](/mechanisms/azure-policy/): Resources at the scope of the assignment (management group, subscription, resource group) and their children, except notScopes and exemptions
- **Taken from:** [open source set](https://raw.githubusercontent.com/Azure/azure-policy/master/built-in-policies/policyDefinitions/Key%20Vault/Recoverable_Audit.json), 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 deletion](/guardrails/aws-scp-deny-kms-key-deletion/): AWS, Service control policies (SCPs), encryption and keys
- [Enforce a 30-day KMS key deletion window](/guardrails/aws-scp-kms-30-day-deletion-window/): AWS, Service control policies (SCPs), encryption and keys
- [Deny disabling default EBS encryption](/guardrails/aws-scp-deny-disable-ebs-default-encryption/): AWS, Service control policies (SCPs), encryption and keys
- [Storage accounts should have the specified minimum TLS version](/guardrails/azure-policy-storage-min-tls/): Azure, Azure Policy (built-in definitions), encryption and keys
- [OS and data disks should be encrypted with a customer-managed key](/guardrails/azure-policy-disk-cmk/): Azure, Azure Policy (built-in definitions), encryption and keys

## Related pages

- [Azure Key Vault should use the RBAC permission model (Azure Azure Policy)](/guardrails/azure-policy-keyvault-use-rbac/)
- [Configure key vaults to enable the firewall (Azure Azure Policy)](/guardrails/azure-policy-keyvault-firewall/)
- [OS and data disks should be encrypted with a customer-managed key (Azure Azure Policy)](/guardrails/azure-policy-disk-cmk/)

## Sources

- Key vaults should have deletion protection enabled: https://raw.githubusercontent.com/Azure/azure-policy/master/built-in-policies/policyDefinitions/Key%20Vault/Recoverable_Audit.json (read 10 Nov 2026)
- How to test it first: https://learn.microsoft.com/en-us/azure/governance/policy/concepts/assignment-structure (read 10 Nov 2026)

Last reviewed 16 Nov 2026. Canonical: https://cloudgovernancetools.com/guardrails/azure-policy-keyvault-purge-protection/
