'do you need to login - using `az devops login` - when AZURE_DEVOPS_EXT_PAT is set?

Do I still need to login using az devops login in cli to work on Azure DevOps when I already have PAT set using environment variable?

I tried the code below on three workstations but it keeps failing on third workstation:

  1. Ubuntu running in Azure
  2. Ubuntu running locally in the container in my laptop
  3. WSL (Ubuntu) running locally in my laptop
export AZURE_DEVOPS_EXT_PAT=******************
organization="https://dev.azure.com/myorg/"
az devops project list --organization $organization

Note that I am able to retrieve the project list from the first two "workstations" without invoking az devops login, but unable to retrieve so on my WSL, and I am getting the following error message:

Before you can run Azure DevOps commands, you need to run the login command(az login if using AAD/MSA identity else az devops login if using PAT token) to setup credentials. Please see https://aka.ms/azure-devops-cli-auth for more information.

Any idea of what would contribute to this inconsistency?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source