azure-devops-cli-extension icon indicating copy to clipboard operation
azure-devops-cli-extension copied to clipboard

az devops (bash) with Cloud Shell does not seem to support using the session az login, or existing session on cloud shell for az devops context

Open jsa2 opened this issue 2 years ago • 2 comments

This is autogenerated. Please review and update as needed.

Describe the bug

Described temporary fix here

Command Name az devops project show Extension Name: azure-devops. Version: 0.20.0.

Errors:

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.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

In cloud shell try the following

subName="Your Sub"
az account set --subscription "$subName"
DevopsProject=yourProj
DevopsOrg=yourOrg
az devops configure --defaults organization=https://dev.azure.com/$DevopsOrg
# Before continuing, ensure az devops project list command works (This will confirm, that you are logged in)
az devops project show -p $DevopsProject
  • Put any pre-requisite steps here...
  • az devops project show -p {}

Expected Behavior

With AZ CLI (locally installed) any az devops command can use the existing session

Environment Summary

Linux-5.4.0-1061-azure-x86_64-with-debian-10.2 (Cloud Shell), Common Base Linux Delridge (quinault)
Python 3.6.10
Installer: DEB

azure-cli 2.28.0 *

Extensions:
azure-devops 0.20.0
ai-examples 0.2.5
ssh 0.1.6

Additional Context

jsa2 avatar Oct 16 '21 04:10 jsa2

Using Az login context seems to work if you force new login in the beginning of session (Az login)

jsa2 avatar Oct 16 '21 05:10 jsa2

That workaround didn't work for me. I had to use a PAT and az devops login.

WaitingForGuacamole avatar Nov 03 '21 19:11 WaitingForGuacamole