microsoft / azure-pipelines-terraform

Azure Pipelines tasks for installing Terraform and running Terraform commands in a build or release pipeline.
MIT License
104 stars 63 forks source link

Error building ARM Config: obtain subscription() from Azure CLI: parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1: ERROR: Please run 'az login' to setup account #245

Open ramesh569 opened 2 weeks ago

ramesh569 commented 2 weeks ago

Hi Team,

we are trying to run terraform init command but its throwing the error mentioned in tittle.

here is the task

    - task: TerraformTaskV4@4
  inputs:
    provider: 'azurerm'
    command: 'init'
    workingDirectory: '$(System.DefaultWorkingDirectory)/terraform'
    commandOptions: '-migrate-state'
    backendAzureRmUseEnvironmentVariablesForAuthentication: true
    backendAzureRmUseEntraIdForAuthentication: true
    backendServiceArm: 'xxxxxxxxxxxxx'
    backendAzureRmResourceGroupName: 'rg-xxxx-dev'
    backendAzureRmStorageAccountName: 'saterrastore
    backendAzureRmContainerName: 'xxxxxxx'
    backendAzureRmKey: 'terraform-dev.tfstate'

service connection has owner role on subscription level and should be able to access all the resources in subscription. but not sure why its asking to login.

please suggest

mericstam commented 2 weeks ago

Hi, What is your reason for running -migrate-state? switching backends?

br Manuel