locked
Unable to remove Key Vault with Soft Delete enabled RRS feed

  • Question

  • Created a bunch of test vaults with purge protection and soft delete enabled and want to test my script again but cannot because it says the vault exists.  When I try to run this command I get the following error.  How can I accomplish this?

    Get-AzKeyVault -InRemovedState | Remove-azkeyvault -InRemovedState -Location 'East US' -Confirm:$false -Force -Verbose


    "I live and die by the command line" -JL 2010 © ©

    Wednesday, August 28, 2019 1:23 PM

All replies

  • Whenever soft-delete and purge protection is enabled on the key vault , the key vault  isn't actually deleted or purged for a retention period of 90 days giving you chance to recover the key vault.

    For more information about the soft-delete behavior and purge protection, kindly refer this article.It provides an insight of why you are receiving the mentioned error.

    Hope this helps!


    Thursday, August 29, 2019 5:56 AM