Azure CI/CD pipeline not recognizing the state file appended in azure backend

I used terraform import to retrieve the statefile contents of some azure resources by writing resource configuration block for the resource. After importing I appended the state file in azure storage and also added the resource configuration to our CI/CD pipeline.

Ideally after ‘terraform plan’ should show no change in infrastructure. But the CI/CD pipelines shows changes. But when i run terraform plan on my local machine it shows no changes to infra. Both CI/CD pipeline and my local point to the same backend file in azure storage.

below is the screenshot of both the plans.

image

Somehow the CI/CD pipeline is not able to recongnize the statefile or I’m missing out on some small detail. It will be helpful if someone can suggest something

Add TF_LOG (in ADO) and review if you are able to use the remote state at all.

Version of TF and provider is the same?

Hi @kethasid,
could you confirm that the backend configuration and also terraform init incl. backend were applied properly?

Issue got resolved by upgrading the terraform version on the build agents cluster. It was running an older version and hence it was unable to detect the statefile changes for the new code. Thank you for the assistance