I am currently stuck at the init point in the Azure DevOps Pipeline. So I successfully install Terraform, but in the next step it already fails.
pool:
name: Azure Pipelines
vmImage: ubuntu-latest
variables:
- name: terraform-working-directory
value: '$(System.DefaultWorkingDirectory)/terraform/'
stages :
- stage: terraform
jobs:
- deployment: deploy_terraform
continueOnError: false
environment: 'dev'
strategy:
runOnce:
deploy:
steps:
- task: charleszipp.azure-pipelines-tasks-terraform.azure-pipelines-tasks-terraform-installer.TerraformInstaller@0
displayName: 'install'
inputs:
terraformVersion: '0.14.11'
- task: charleszipp.azure-pipelines-tasks-terraform.azure-pipelines-tasks-terraform-cli.TerraformCLI@0
displayName: 'init'
inputs:
command: 'init'
workingDirectory: $(terraform-working-directory)
backendType: 'self-configured'
Terraform file:
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "=2.63.0"
}
}
backend "azurerm" {
resource_group_name = "xxx"
storage_account_name = "xxx"
container_name = "xxx"
key = "terraform.tfstate"
}
}
It is currently really basic and just in the beginning. The error message I receive is the following:
/opt/hostedtoolcache/terraform/0.14.11/x64/terraform init -backend-config=storage_account_name=xxx -backend-config=container_name=xxx -backend-config=key=xxx -backend-config=resource_group_name=xxx -backend-config=arm_subscription_id=xxx -backend-config=arm_tenant_id=*** -backend-config=arm_client_id=*** -backend-config=arm_client_secret=***
##[error]Error: There was an error when attempting to execute the process '/opt/hostedtoolcache/terraform/0.14.11/x64/terraform'. This may indicate the process failed to start. Error: spawn /opt/hostedtoolcache/terraform/1.0.0/x64/terraform ENOENT
Finishing: terraform init
I've locally started the terraform init and apply, which worked fine