Open aatuch opened 4 weeks ago
@aatuch Could you please provide the debug log when the issue happens so that we can better understand what caused TF regard the containers as absent. Back in the provider code, there are two cases this will happen:
Failed to locate the storage account:
Failed to get the container
@magodo, unfortunately, I cannot provide the debug log since I cannot reproduce the issue.
@aatuch out of interest, are you using the Azure CLI to authenticate?
Is there an existing issue for this?
Community Note
Terraform Version
1.5.4
AzureRM Provider Version
3.107.0
Affected Resource(s)/Data Source(s)
azurerm_storage_container
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Our Terraform configuration has been working without errors for a year, and we have not made any changes to the containers. Terraform should run and output "No changes. Your infrastructure matches the configuration."
Actual Behaviour
In the last week the issue has occurred 4 times on different environments at random times among around 40 deployments to different environments. During deploy container entries in the state file are suddenly deleted. Terraform then tries to create resources that are not in the state and fails with an error when it encounters them in Azure. It was mitigated by importing the container resources. On one environment it reproduced even after the import. Any external or human interference is excluded. The deployment is exclusively run from Azure DevOps pipelines.
Steps to Reproduce
terraform plan or terraform apply
The issue is transient. I cannot reproduce it by just redeploying. It happens randomly. No patterns have been observed.
Important Factoids
No response
References
No response