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
and when prompted for a password in VSCode
entered the new PAT in, but still get
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?
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.
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.
Please also make sure your user account is on or above the Basic access level and NOT a Stakeholder.
@unixcorn
The authentication error shows PAT doesn’t have enough permission for repositories.
The session of the PAT that shows the access you have given is the Code and it is set to only Status
which is not enough permission to manage repositories.
You will need to include at least Code (Read & Write) if you intend to get your code changes pushed to remote repositories. It is advised to adhere to the principle of least privilege, and grant only required access for security best practices. So if the sole purpose of the PAT is to write/pull code changes then you can remove other permissions (Build, Packaging, Release).