How to use Key Vault soft-delete with PowerShell

For an existing key vault named "spiderip", enable soft-delete as follows.

Connect-AzureRmAccount

($resource = Get-AzureRmResource -ResourceId (Get-AzureRmKeyVault -VaultName "spiderip").ResourceId).Properties | Add-Member -MemberType "NoteProperty" -Name "enableSoftDelete" -Value "true"

Set-AzureRmResource -resourceid $resource.ResourceId -Properties $resource.Properties

Comments