I wrote an article last month demonstrating the inner workings and scenarios where the Azure Key Vault Soft Delete feature helps prevent accidental or even malicious deletion of Key Vault. I mentioned that you could restore Azure Key Vault using PowerShell. Here are the two cmdlets to make it happen.
First, we can retrieve all soft-deleted Key Vaults using Get-AzKeyVault -InRemovedState cmdlet, as depicted in the image below.
To restore an Azure Key Vault, use the Undo-AzKeyVaultRemoval, and provide the deleted instance, resource group name, and location.
It is that simple! Using these two cmdlets, we can retrieve any soft-deleted at the subscription level and restore it afterward.
More Quick Tips articles
- Fixing Azure Key Vault when moving to a different tenant
- This overlooked feature in Visual Studio Code can speed release time
- Enabling Front Door managed certificates in Azure: Status update
- How to quickly check the status of all your Azure services
- Using location in a consistent way in your ARM template parameters