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

Failed to store PAT using keyring, az devops cli

Open OisinFoley opened this issue 2 years ago • 1 comments

I’m trying to authenticate toward my Azure DevOps organisation using a personal access token, but keep getting met with the “Failed to store PAT using keyring, falling back to file storage”.

I have tried the steps outlined below, based on suggestions here and here.

CLI version:

  • az cli: 2.44.1
  • azure-devops (extension): 0.25.0

Order of steps (from a fresh install of both Ubuntu 18.04 and Ubuntu 20.04)

  • sudo apt install python3-pip
  • python3 -m pip install -U pip # install latest version of pip
  • installing az cli based on instructions here (as soon as this command finishes, I notice that running ls /opt/az lists a python3.10 directory)
  • sudo pip3 install --target /opt/az/lib/python3.6/site-packages/ keyring~=17.1.1 # keyring package missing by default when booting VM for first time
  • az extension add --name azure-devops
  • regardless of whether I do either of the following commands, I keep getting the same Failed to store PAT using keyring error when trying to login to my org:
    • az devops login --organization https://dev.azure.com/{orgName} (then paste in PAT when prompted)
    • export AZURE_DEVOPS_EXT_PAT variable, then run same az devops login command
    • echo $AZURE_DEVOPS_EXT_PAT | az devops login --organization https://dev.azure.com/{orgName}/

I am out of ideas and would appreciate any suggestions.
Running python3 --version in my terminal returns Python 3.6.9.

For simplicity, I gave the PAT open permissions across the entire Azure DevOps org.

Is there a permission I need to add to the service principal representing Azure DevOps?
Not finding any documentation mentioning this but just an idea i'm investigating.

OisinFoley avatar Jan 16 '23 09:01 OisinFoley

route to CXP team

yonzhan avatar Jan 16 '23 10:01 yonzhan

I am also facing the same issue. Any update on this github issue is appreciated.

hima-gadupudi avatar Mar 29 '23 20:03 hima-gadupudi

az devops is an Azure CLI extension. Please report to https://github.com/Azure/azure-devops-cli-extension instead.

jiasli avatar Mar 30 '23 04:03 jiasli

I am also facing the same issue... Any update how to fix this??

shileshbabu avatar Jun 22 '23 08:06 shileshbabu