DEV Community

Cover image for Purge a soft-deleted Azure Key Vault
Rafał Sroka
Rafał Sroka

Posted on

Purge a soft-deleted Azure Key Vault

If you came here you probably already know that delete a Key Vault in Azure is not as easy as it sounds. Sure, it's gone from the Azure portal. However, when you try to create one using the same name you'll find out that it was not fully deleted.

The following recipe shows how to get rid of the Key Vault, for good.

  1. Install Azure CLI according to the following steps. The example below uses homebrew (macOS).

    brew update && brew install azure-cli
  2. Login and find the soft-deleted key vault you want to purge. If you happen to have multiple subscriptions, use the --subscription param to indicate which one should be searched.

    az login
    az keyvault list-deleted
  3. Purge it

    az keyvault purge --name <keyvault-name>

Top comments (0)