Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authentication failed for Azure Git

I'm trying to clone my webapp in Azure.

When I run git clone https://[email protected]:443/appname.git the terminal asks me for my password.

But when I fill in my password, it keeps saying that the authentication has failed.

Even though I changed my password plenty of times in the Portal (Settings -> Set deployment credentials).

Any reason it keeps saying that my authentication has failed?

like image 598
Arn Vanhoutte Avatar asked Jan 17 '16 10:01

Arn Vanhoutte


People also ask

How do I connect to Azure Git?

Open Project Settings>GitHub Connections. Sign into Azure Boards for the project you want to connect to GitHub repositories. Choose (1) Project Settings> (2) GitHub connections. If it's the first time making a connection from the project, choose Connect your GitHub account to use your GitHub account credentials.


2 Answers

Yes many of the answers here are pointing to the correct path, but my case:- I was given an url to access git repos on azure cloud for which I'm perfectly fine to access/browse the code on browser (Vs) when I'm trying to clone I've got the same issue.

So when you click on clone as shown in below image, you've to Generate Git credentials, this is weird, not sure why, probably they've setup my account to access azure cloud, which can't be used to clone git repos(means can't be used as git credentials), this is something different from what I've seen with AWS/gitlab/bitbucket, maybe an issue with account setup, or if it's common thing for repos on Azure & if you're in same issue - give it a try. enter image description here

Another one, as everyone has already mentioned, please don't try to connect to url which is produced over there (something looks like):

https://[email protected]/project-name/apps/_git/library/ 

instead try to connect thru your GIT username & then use password :

https://[email protected]/project-name/apps/_git/library/ 

as a tip if your username has special characters in it, Git cmd/bash will through errors, So replace those with valid characters, ex. :-

  1. @ can be replaced with %40
  2. + can be replaced with %2B

something like : https://username%[email protected]/project-name/apps/_git/library/

like image 165
whoami - fakeFaceTrueSoul Avatar answered Sep 23 '22 07:09

whoami - fakeFaceTrueSoul


I had the same problem with my site and it turned out the issue is with the site url: the automatically generated remote url was: https://[email protected]/site.git

On the other hand the portal showed: https://[email protected]:443/site.git

After updating the remote url in git with the following command:

git remote set-url azure https://<user>@<site>.scm.azurewebsites.net/<site>.git https://<user>@<site>.scm.azurewebsites.net:443/<site>.git 

things started working as expected.

The morale of the story: check the deployment url as well as the password.

like image 38
vizmi Avatar answered Sep 22 '22 07:09

vizmi