Restore Azure Key Vault using just two PowerShell cmdlets

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.

restore Azure Key Vault

To restore an Azure Key Vault, use the Undo-AzKeyVaultRemoval, and provide the deleted instance, resource group name, and location.

restore Azure Key Vault

It is that simple! Using these two cmdlets, we can retrieve any soft-deleted at the subscription level and restore it afterward.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top