How are people handling KeyVault deletes? When I d...
# azure
r
How are people handling KeyVault deletes? When I delete my KV it gets soft deleted and when I go to Pulumi up again it detects the old keyvault and complains I need to either purge or restore it. I know the classic provider you could specify what you'd like to do. How have people been handling this?
c
When I testing, I start with 01 and just increment the number as I go along. This way when I happy with the design, my "permanent" keyvault name is not taken. You can also purge the vault via CLI or PowerShell. https://docs.microsoft.com/en-us/azure/key-vault/general/key-vault-recovery?tabs=azure-powershell#key-vault-powershell
m
It would be ideal for there to be a delete option in azure-native that includes purging. Purging is a first-class component of the API. App Configs are in the same boat. I've played around with the Local Command package, but there are quirks with it (e.g. it only seems to get registered during a pulumi up, not during a destroy). So I've been running the Az CLI after a destroy, e.g.:
Copy code
((az keyvault list-deleted) | ConvertFrom-Json) | % { az keyvault purge --name $_.name --location $_.properties.location };
((az appconfig list-deleted) | ConvertFrom-Json) | % { az appconfig purge --name $_.name --location $_.location --yes };
❤️ 1