Unable to delete Azure Key Vault due to Purge protection

Iqbal Johar 1 Reputation point
2025-10-01T11:07:10.2466667+00:00

Hello Everyone,

How can I disable the Purge protection accidentally enabled during creation. Getting error while deleting.

Remove-AzKeyVault -VaultName "hsmkv1" -Location "West US" -InRemovedState -Force

Remove-AzKeyVault: Operation 'DeletedVaultPurge' is not allowed.

User's image

Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Andrew Coughlin 320 Reputation points Microsoft Employee
    2025-10-02T13:26:32.2733333+00:00

    Hello Iqbal,

    Welcome to the Microsoft Q&A Community. Unfortunately, once enabled on an Azure Key Vault or Managed HSM, Purge Protection cannot be disabled or overridden, even by administrators. This feature is permanent and enforces a mandatory retention period (typically 90 days) during which deleted items cannot be purged. To address related issues, users can either wait for the retention period to expire, use a different name, or plan ahead for future deployments.

    Azure Key Vault recovery overview | Microsoft Learn

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.