unfortunately my ARM template deployment (using azure DevOps service connection which has subscription level access) deleted azure keyvault which has soft-delete enable with 90 period but we cannot recovered from portal or Azure CLI. it showing empty array []
Note: when we are trying to re-create keyvault with same name it is saying keyvault is in soft-delete state so can't create with same name.
how to recovered my keyvault?
If you have enabled
soft-delete
for your Azure Key Vault, you should be able to recover it within the retention period (90 days by default). Here are the steps you can follow to recover your Key Vault:First verify if you have enabled soft delete on your key vault via portal or CLI
Output-
If yes, and if you have deleted that, then you can list it from portal or CLI
or under
key-vault
->manage deleted keyvaults
in portalIf it is listed there, click on it and you can recover it. or from CLI
Since you mentioned that you are unable to create a new Key Vault with the same name, you may need to wait until the retention period for soft-delete has expired before you can create a new Key Vault with the same name.
This is the overall step to recover your vault. If you are still unable to recover using the same then below are the checks you need to do
Ensure that your Azure DevOps service connection has sufficient permissions to manage Key Vaults in the specified subscription. Check the RBAC (Role-Based Access Control) settings for the service connection. You should have
key vault contributer
oradministrator
enabled- and the vault you are trying to recover must not pass the retention period.Reference documents: MS Doc