Hi,
I created a IaC Pipeline with terraform and azure devops. In the devops pipeline a added a storage account to store the tfstate file in the blob storage. When I run the pipeline, everything works, all services are created, but a can’t find the tfstate file in the storage account. here is the code of the yaml file:
jobs:
- deployment: deployDev
continueOnError: false
environment: 'dev'
strategy:
runOnce:
deploy:
steps:
- checkout: self
- task: TerraformInstaller@0
displayName: 'install'
inputs:
terraformVersion: '0.12.3'
- task: TerraformTaskV1@0
displayName: 'init'
inputs:
provider: 'azurerm'
command: 'init'
backendServiceArm: ' (XXX)'
backendAzureRmResourceGroupName: 'terraform-rg'
backendAzureRmStorageAccountName: 'editerraformaccount'
backendAzureRmContainerName: 'editerraformcontainer'
backendAzureRmKey: 'terraformDev.tfstate'
workingDirectory: $(System.DefaultWorkingDirectory)/Terraform/Dev
- task: TerraformTaskV1@0
displayName: 'plan'
inputs:
provider: 'azurerm'
command: 'plan'
#commandOptions: '-input=false'
environmentServiceNameAzureRM: ' (XXX)'
workingDirectory: $(System.DefaultWorkingDirectory)/Terraform/Dev
- task: TerraformTaskV1@0
displayName: 'apply'
inputs:
provider: 'azurerm'
command: 'apply'
#commandOptions: '-input=false -auto-approve'
environmentServiceNameAzureRM: ' (XXX)'
workingDirectory: $(System.DefaultWorkingDirectory)/Terraform/Dev
Any ideas?
regards
Andreas