I can't Delete my KeyVault Resource

ENGELS JIMENEZ 0 Reputation points
2024-04-27T16:35:32.72+00:00

User's image

I tried anything but i don't know what can i do to force keyvault deletion and remove this warning.

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.
1,135 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Dillon Silzer 54,731 Reputation points
    2024-04-27T16:55:50.6133333+00:00

    Hi Engels,

    Have you ensured all of the following resources have been deleted?

    You can't delete a Recovery Services vault with any of the following dependencies:

    • You can't delete a vault that contains protected data sources (for example, IaaS VMs, SQL databases, Azure file shares).
    • You can't delete a vault that contains backup data. Once backup data is deleted, it will go into the soft deleted state.
    • You can't delete a vault that contains backup data in the soft deleted state.
    • You can't delete a vault that has registered storage accounts.

    Also:

    Disable the soft delete and Security features

    1. Go to Properties -> Security Settings and disable the Soft Delete feature if enabled. See how to disable soft delete.
    2. Go to Properties -> Security Settings and disable Security Features, if enabled. Learn more

    Also:

    Unregister Storage Accounts

    Ensure all registered storage accounts are unregistered for successful vault deletion. Go to the vault dashboard menu > Backup Infrastructure > Storage Accounts. If you've storage accounts listed here, then you must unregister all of them. Learn more how to Unregister a storage account.

    Also:

    Remove Private Endpoints

    Ensure there are no Private endpoints created for the vault. Go to Vault dashboard menu > Private endpoint Connections under 'Settings' > if the vault has any Private endpoint connections created or attempted to be created, ensure they are removed before proceeding with vault delete.

    Ensure everything above is removed.

    If this is helpful please accept answer.

    0 comments No comments

  2. Andreas Baumgarten 97,486 Reputation points MVP
    2024-04-27T16:57:50.5933333+00:00

    Hi @ENGELS JIMENEZ ,

    the error message is pointing to existing containers or private endpoints related/associated with the KeyVault.

    If deleting the KeyVault is not working via Azure Portal you can give it a try to use PowerShell (Az Module) including the -Force parameter: Remove-AzKeyVault


    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards

    Andreas Baumgarten

    0 comments No comments