Lesstep
Azure DevOps Services · Azure CLI · Microsoft Entra · Checked November 22, 2026

Azure CLI: "Interactive authentication is needed. Please run: az login --scope"

The Azure CLI has a saved sign-in, and Microsoft Entra refused to give an Azure DevOps token from it without you doing something again: a multi-factor prompt, a sign-in from a managed device, a fresher login. az account get-access-token cannot show a prompt, so it stops and prints the command that can. Run that command exactly as printed, in a terminal. For Azure DevOps it asks for the Azure DevOps resource: az login --scope 499b84ac-1321-427f-aa17-267ca6975798/.default. A plain az login does not always satisfy it. If the line above the command is an AADSTS code about the device, no command fixes it: that is a Conditional Access rule of your tenant.

What it looks like

A report on Microsoft Q&A of the same message for another resource (Microsoft Graph, posted November 27, 2023):

AADSTS530003: Your device is required to be managed to access this resource. Trace ID: ... Correlation ID: ... Timestamp: ...

Interactive authentication is needed. Please run:
az login --scope https://graph.microsoft.com/.default

The two parts are separate. The line with AADSTS and a number is the reason Microsoft Entra gave. The last two lines are the Azure CLI telling you how to sign in again for that one resource. The command you get for Azure DevOps names the Azure DevOps resource in the same way; use the one your terminal prints.

Where it shows up in the IDE: Azure DevOps Pull Requests, a plugin for JetBrains IDEs, runs az account get-access-token for you when you choose "Use my Azure CLI sign-in", so it meets this message too.

Run the command it prints

az login --scope 499b84ac-1321-427f-aa17-267ca6975798/.default

The reference for az login says of --scope: "Used in the /authorize request. It can cover only one static resource." That is why it is a separate login for one resource, and why a plain az login that worked for Azure Resource Manager can still leave the Azure DevOps token out of reach. When the browser sign-in is done, try again:

az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --query accessToken -o tsv

499b84ac-1321-427f-aa17-267ca6975798 is the Azure DevOps application ID that Microsoft's page Issue Entra tokens with Azure CLI uses as the resource. A token is printed: it works, and lasts about an hour.

What the AADSTS line tells you

With az account get-access-token, --tenant is "only available for user and service principal account, not for managed identity or Cloud Shell account" (az account), so it does not apply to those accounts.

In the IDE

Azure DevOps Pull Requests, a plugin by Lesstep for JetBrains IDEs 2024.1 or later and Android Studio, can use your Azure CLI sign-in instead of a personal access token on Azure DevOps Services. It runs az account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798 --output json (with --tenant when Azure DevOps names the organization's tenant), waits up to 30 seconds for it, and keeps the token in memory only. If the command fails and its error text contains "az login", which this message does, the plugin shows "The Azure CLI is not signed in. Run az login in a terminal, then refresh." For this case run the full az login --scope ... command from your own terminal output, not just az login, then refresh the list. For any other failure the plugin shows "The Azure CLI could not get a token for Azure DevOps:" followed by the first line of the Azure CLI's error. The Azure CLI sign-in is not used on Azure DevOps Server. Reading is free; voting, commenting and completing are Pro, with a 30-day trial.

Get it on JetBrains Marketplace

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

More: When you cannot create a personal access token · VS30063 · az repos pr and signing in to the Azure CLI · 日本語

Sources