microsoft / azure-pipelines-terraform

Azure Pipelines tasks for installing Terraform and running Terraform commands in a build or release pipeline.
MIT License
101 stars 62 forks source link

Error: Failed to read variables file │ │ Given variables file ../CazD_Xxx/azure-xx/terraform.tfvars │ does not exist. #126

Closed abhijeetdhoke closed 1 year ago

abhijeetdhoke commented 1 year ago

Hello Team,

I am getting below error when I am running azure pipeline with terraform.

This is the error "Error: Failed to read variables file │ │ Given variables file ../CazD_Terraform/azure-resources/terraform.tfvars │ does not exist. "

This is ymal file..

mericstam commented 1 year ago

../CazD_Terraform/azure-resources/terraform.tfvars does not seem to be the correct path. your workingDirectory is set to CazD_Terraform/azure-resources.

I would use $(Pipeline.Workspace) or $(Build.SourcesDirectory) and then as working dir. ex workingDirectory: $(Build.SourcesDirectory)/CazD_Terraform/azure-resources and then use: -var-file='terraform.tfvars'

As I don't know your your specific folder structure and the steps before so you might need to append whatever folderpath you have as the workingdirectory

mericstam commented 1 year ago

Closing this due to inactivity. If you still have problems create a new issue or just respond back here.