4
votes

We have several pipelines in Azure-Devops performing Terraform init-plan-apply. Until now worked fine. But all of a sudden we are getting these errors in the Init phase.

Initializing the backend...
╷
│ Error: Invalid backend configuration argument
│ 
│ The backend configuration argument "arm_subscription_id" given on the command line is not expected for the selected backend type.
╵ Error: Invalid backend configuration argument
│ 
│ The backend configuration argument "arm_tenant_id" .....
│ The backend configuration argument "arm_client_id" .....
│ The backend configuration argument "arm_client_secret" ....

On the hasicorp website I found a remark on this https://www.terraform.io/upgrade-guides/0-15.html . But thegeneration of the init command is completelly done by DevOps, there is no place where I can change the arm_client_id to client_id (and the others).

Anybody has seen this behaviour and being able to solve it.

1

1 Answers

2
votes

I spent about 2 hours on this issue today and I found that I had to perform the following.

  1. I had to install Terraform 0.14.11 as the new 0.15.1 was failing

  2. In your Terraform init task, add -reconfigure to Additional command arguments

  3. Although my terraform code worked fine on my PC, I was getting the same errors as you are. In my main.tf file, I removed all reference to my backend since they are already defined in the init task

    terraform {
      required_providers {
        azurerm = {
          source  = "hashicorp/azurerm"
          version = "=2.48.0"
        }
      }
    }
    
    provider "azurerm" {
      features {}
    }
    
    terraform {
      backend "azurerm" {
      }
    }