New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_key_vault has "ConflictError" when building, recommended fix from Azure is to serialize actions #15127
Comments
I've just tried using |
Looks like this could be due to the soft deleted key conflicting with the new key being created which has the same name. I'm testing this out by adding this to the azurerm features block:
|
@jblackwood12 thanks for opening this issue. If this issue persists after testing, could you please provide your terraform config that could help repro and troubleshooting? |
@sinbai I've resolved the issue. As of 1/19/2022, Azure started ensuring "soft-delete" was used when deleting a "Key Vault". The application we were using to communicate to Azure (via Terraform) did not have permissions to purge soft-deleted Key Vaults. So, I delegated an Azure Key Vault role which had the "purge" soft-delete permission. And, also I've used the block I mentioned above. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Terraform (and AzureRM Provider) Version
2.93.1
Affected Resource(s)
Terraform Configuration Files
Debug Output
Error: creating Vault: (Name "samplekvname" / Resource Group "samplergname"): keyvault.VaultsClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=<nil> Code="ConflictError" Message="A conflict occurred that prevented the operation from completing. The operation failed because the Key Vault 'samplekvname' changed from the point the operation began. This can happen if parallel operations are being performed on the Key Vault. To prevent this error, serialize the operations so that only one operation is performed on the Key Vault at a time. Follow this link for more information: https://go.microsoft.com/fwlink/?linkid=2147741
Panic Output
Expected Behaviour
Should have built the "azurerm_key_vault"
Actual Behaviour
Fails to build the "azurerm_key_vault"
Steps to Reproduce
terraform apply
Important Factoids
References
The text was updated successfully, but these errors were encountered: