In the sample code to deploy infrastructure, key vault uses the default setting which enables soft delete.
As a result, once we delete key vault and recreate it, we will encounter an issue since key vault is still there (soft delete mode).
We could either disable soft delete for key vault, or check if the key vault is in soft delete mode, if so, restore it, otherwise create it.
DoD
Clean Up bash script modified to include the soft deletion of the previously created Key Vault
On the cases that the Clean-Up scripts wasn't used, then the deployment script needs some changes. The script should check if the key vault in the current deployment is on the soft delete list. If so - there might be 2 approaches that can be investigated - either restoring the deleted key vault or hard deleting it and re-creating it for the new deployment.
In the sample code to deploy infrastructure, key vault uses the default setting which enables soft delete. As a result, once we delete key vault and recreate it, we will encounter an issue since key vault is still there (soft delete mode). We could either disable soft delete for key vault, or check if the key vault is in soft delete mode, if so, restore it, otherwise create it.
DoD