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
- Reading text files with PowerShell and Linux bash shell
- Integrating Microsoft Defender with Cloud App Security
- New from Microsoft: Azure Security Center onboarding guide
- Fixing Azure Key Vault when moving to a different tenant
- This overlooked feature in Visual Studio Code can speed release time