Search code examples
azureazure-devops

PAT Token doesn't work for authenticating into Azure DevOps


I found out that my PAT wasn't working when I tried to push to remote and got an 'Authentication failed' message. So I generated a new PAT enter image description here

and when prompted for a password in VSCode enter image description here

entered the new PAT in, but still get enter image description here

I've tried logging in and out of Azure Devops (no problemo) and for now, have resorted to directly making changes in the master branch using the Azure Devops UI which is absolutely bonkers.

Any suggestions on how I could solve this?


Solution

  • From the I screenshot that you shared, it seemed that the PAT against which you authenticated to push commits to Azure Repos, lacked the required authorization scope of Code (Read & write). Please create a new PAT following the marks in the image below.

    Image

    We can also try and run git clone <repo_url> command to generate a valid PAT to read and write the code in the cloud repo. This operation will create a new PAT for us as well.

    Image

    Please also make sure your user account is on or above the Basic access level and NOT a Stakeholder.

    enter image description here