Lesstep
Azure Pipelines · Azure CLI · Checked November 7, 2026

Azure Pipelines: "Please run 'az login' to setup account"

On a pipeline agent nobody has run az login. The Azure CLI is signed in only inside the Azure CLI task (AzureCLI@2), which signs in with an Azure Resource Manager service connection before your script and signs out after it. Any az command outside that task finds no account and stops with this message. The Azure DevOps commands (az devops, az repos, az pipelines, az boards) are different again: they take a token from AZURE_DEVOPS_EXT_PAT.

If the step creates, votes on or completes pull requests with az repos pr, the same pull requests can wait for you in the IDE: Azure DevOps Pull Requests, a plugin for JetBrains IDEs, lists the pull requests that wait for your review in IntelliJ IDEA, PyCharm or Rider, and on Azure DevOps Services it can use your own Azure CLI sign-in instead of a token. Get it on JetBrains Marketplace

What it looks like

Where az has no sign-in

Azure commands: run them inside the Azure CLI task

- task: AzureCLI@2
  inputs:
    azureSubscription: 'my-arm-connection'
    scriptType: bash
    scriptLocation: inlineScript
    inlineScript: |
      az account show
      az webapp deploy --resource-group rg-demo --name app-demo --src-path app.zip

Azure DevOps commands: AZURE_DEVOPS_EXT_PAT

- bash: |
    az repos pr list --organization '$(System.TeamFoundationCollectionUri)' --project '$(System.TeamProject)' --status active
  env:
    AZURE_DEVOPS_EXT_PAT: $(System.AccessToken)

Azure DevOps pull requests in IntelliJ IDEA, PyCharm and Rider

Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, reads the organization, project and repository from your git remote and lists the pull requests that wait for your review in an IDE tool window, on Azure DevOps Services and on Azure DevOps Server. It signs in with a personal access token, or on Azure DevOps Services with your Azure CLI sign-in (az login), for organizations that restrict tokens. The review inbox is free; voting, commenting, completing and creating are Pro, with a 30-day trial. For the same tasks from a terminal, see az repos pr and the Azure CLI.

Get it on JetBrains Marketplace

Azure, Azure DevOps and Azure Pipelines are trademarks of Microsoft Corporation; IntelliJ IDEA, PyCharm and Rider are trademarks of JetBrains s.r.o. This page is not affiliated with or endorsed by Microsoft or JetBrains.

More: AADSTS7000215 and AADSTS7000222: the service connection secret · az repos pr and the Azure CLI · TF401027: GenericContribute permission · This pipeline needs permission to access a resource · 日本語