hashicorp / azure-pipelines-extension-terraform

Azure DevOps Pipeline Extension for Terraform
Mozilla Public License 2.0
62 stars 23 forks source link

Missing tfstate when using separate service connection for backend #15

Open mariussm opened 4 years ago

mariussm commented 4 years ago

Issue When configuring a separate service connection for the Azure RM backend than the planning and apply stages, there is no way to get the tfstate to actually be stored in the expected Azure storage account.

The apply successfully deploys stuff, but the tfstate is not stored anywhere (probably still local to the pipeline host)

Our configuration

terraform { required_providers { azurerm = { source = "hashicorp/azurerm" version = "~>2.24.0" } } }

A workaround We have added a Azure CLI step instead of the terraform init step, using list keys and generating a separate backend.tf file, that is only used during the release pipeline, before trigger terraform init in the script:

https://pastebin.com/Ky3QMC76

mariussm commented 4 years ago

Anyone?