Authentication failed for Azure Git

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/


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.


Accepted answer did not work for me but this worked.

  1. Check your set Azure URL with

    git config --get remote.<azure-remote-name>.url
    
  2. Reset azure url with following command

    git remote set-url <azure-remote-name>
    https://<user>@<sitename>[_<slotName>].scm.azurewebsites.net:443/<site>.git
    
  3. Try pushing your code using

    git push <azure-remote-name>
    
  4. It will open windows authentication screen which says to enter credential to connect to https://<user>@<sitename>[_<slotName>].scm.azurewebsites.net/<site>.git

  5. Cancel this window. It will prompt the basic credential window which says to enter credential to connect to https://<user>@<sitename>[_<slotName>].scm.azurewebsites.net:433/<site>.git

Enter in your credential and it works.


Since azure does not support ssh you will have to use your password at least once (in some cases you will not be prompt for password next time)

Here is an article describe how to set it up

https://azure.microsoft.com/en-us/documentation/articles/web-sites-publish-source-control/

And here is how to set up git with Azure: http://weblogs.asp.net/shijuvarghese/building-and-deploying-windows-azure-web-sites-using-git-and-github-for-windows


Here are the steps that you followed

If this is your first time setting up a repository in Azure, you need to create login credentials for it.

You will use them to log into the Azure repository and push changes from your local Git repository. From your web app's blade, click Settings > Deployment credentials, then configure your deployment username and password.

When you're done, click OK.

Now do this:

enter image description here