az deployment group what-if does not correctly report on soft deleted Azure Key Vaults
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
> ### `az feedback` auto-generates most of the information requested below, as of CLI version 2.0.62
**Describe the bug**
In the scenario where a keyvault has been deleted, and not purged - the what-if analysis predicts a new KeyVault will be created successfully.
In reality, it errors
`ERROR: ***"status":"Failed","error":***"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[***"code":"Conflict","message":"***\r\n \"error\": ***\r\n \"code\": \"ConflictError\",\r\n \"message\": \"A vault with the same name already exists in deleted state. You need to either recover or purge existing key vault. Follow this link https://go.microsoft.com/fwlink/?linkid=2149745 for more information on soft delete.\"\r\n `
**To Reproduce**
1. Create a KV from Bicep/Arm template
2. Delete the KV in the portal
3. Run the az deployment group What-If on the Bicep/Arm template
**Expected behaviour**
An error be reported that the deployment will fail due to the Key Vault still existing in a soft deleted status.
Contributor guide
Assessment
This issue has not been assessed yet.