I am tying to run terraform on my azure Devops pipeline. I am using the terraform extension version 0.1.8 from the marketplace by MicrosoftDevLabs My task looks as below :
task: TerraformTaskV1@0
displayName: 'Terraform - Init'
inputs:
provider: 'azurerm'
command: 'init'
commandOptions: '-input=false'
backendServiceArm: 'service-connection'
backendAzureRmResourceGroupName: 'Project-RG'
backendAzureRmStorageAccountName: 'projectsa'
backendAzureRmContainerName: 'tfstate'
backendAzureRmKey: 'terraform.tfstate'
workingDirectory: terraform
The command it tries to execute is
`/opt/hostedtoolcache/terraform/0.13.5/x64/terraform init -backend-config=storage_account_name=projectsa -backend-config=container_name=tfstate -backend-config=key=terraform.tfstate -backend-config=resource_group_name=Project-RG -backend-config=arm_subscription_id=xxxx-xxxx-xxxx -backend-config=arm_tenant_id=*** -backend-config=arm_client_id=*** -backend-config=arm_client_secret=***’
And the error message is:
Initializing the backend...
Error: Invalid backend configuration argument
The backend configuration argument "storage_account_name" given on the command line is not expected for the selected backend type.
Error: Invalid backend configuration argument
The backend configuration argument "container_name" given on the command line is not expected for the selected backend type.
Error: Invalid backend configuration argument
The backend configuration argument "key" given on the command line is not expected for the selected backend type.
Initializing the backend... Error: Invalid backend configuration argument The backend configuration argument "storage_account_name" given on the command line is not expected for the selected backend type. Error: Invalid backend configuration argument The backend configuration argument "container_name" given on the command line is not expected for the selected backend type. Error: Invalid backend configuration argument The backend configuration argument "key" given on the command line is not expected for the selected backend type.
– Cloudhubzawsaz