Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Azure DevOps with Sourcetree - Adding a remote account Edited

I'm trying to add my Azure DevOps remote account to the list of accounts I have in Sourcetree same way as other providers: Untitled.png

However, nothing I do seems to work when I try to add a new one (with Azure DevOps selected as Hosting Service):

  • I tried with the email and account I use to log in DevOps which greets me with VS30063 Not authorized (I have full admin rights).
  • I've generated a PAT inside DevOps and used it as a password to the account (as per instruction) which results in: Failed to check login for *user*. Insufficient authentication credentials. Sourcetree could not find password for *user* at *DevOps link*.Untitled.png
  • I've also tried using the PAT as a username (and still providing the account password) with the same result as above.

What exactly is the procedure for connecting the two, and what exactly is SourceTree expecting as an input for an Azure DevOps account?

 

5 answers

1 accepted

21 votes
Answer accepted

Apparently (at the time of writing 23.04.2019), when writing the host URL rather than writing:

https://dev.azure.com/*username*

one should still write it in the old VSTS link format (even if the organization has been made on DevOps):  

https://*username*.visualstudio.com

When using this as host URL, and then using the account name used to log in DevOps as username and the PAT as password, it's working. 

This is still the case in the SourceTree 3.2.0 Windows beta that is only a few days old. When trying to authorize with https://dev.azure.com/OrgName, it seems to succeed in logging in, but fail at gaining Git permissions. Swapping to https://OrgName.VisualStudio.com works immediately. Remotes will work fine with the dev.azure.com format after this initial account authorization.

Any remote repository added using the old Generic Account / Generic Host method (3.1.3 on Windows still had no DevOps integration) should still work if you didn't regenerate the token those remotes use. If, like me, you regenerated your token you use for SourceTree so you could get the password, you will need to edit the DevOps remotes and select the new DevOps Host entry instead of the old Generic Host.

Like # people like this

After trying an failing many times, this worked for me as well!

same for me ... dev.azure.com link DON't work :(

This worked for me as well with the Personal Access Token.

Ok, so I fought with this for the entire afternoon until I figured out (a) where to find my "OrgName", and (b) specifically what to enter for the URL.

In the Azure DevOps portal, it tells me that my repository is at a URL like this:

https://MyCompanyName[at]dev.azure.com/<a bunch more stuff>

So, the URL that worked for me was:

https://MyCompanyName.visualstudio.com

The part that had me messed up is that it doesn't want anything other than this "base" URL (subdomain dot host). Don't include any of the navigation stuff after the slash.

Like # people like this

You will try, and think you are not successful, but you are really near from it ! follow with me:

I am using SourceTree for Windows version 3.2.6

1- Tools -> Options -> Authentication

2- Remove all Visual Studio (or DevOps). Click Ok.

3- Close SouceTree completely. I closed Visual Studio as well, just in case !

3.5 - I switched to DevOps format from Organization settings in DevOps website. So, if you want to follow exactly what I did, do it. Currently it is possible to return back to old format xxx.visualstudio.com. It is your decision !

4- Open SourceTree, go again to Tools -> Options -> Authentication.

5- Enter Host URL as follows: https://dev.azure.com/YourOrgName

6- Prepare your new Personal Access Token, then click "Refresh Personal Access Token" button. Ensure you have this token saved somewhere TEMPORARILY because we will need it.

7- Enter your email as username, and the just generated PAT as password.

It will tell you it failed, do not worry it did not !

8- Click Ok then Close SourceTree Completely.

9- Remove the password cache file called "passwd" in "C:\Users\{YOUR_USER_NAME}\AppData\Local\Atlassian\SourceTree".

10- Open sourcetree again. You can go again to Authentication of SourceTree and see your account has actually been added !

11- Ensure that your repository setting of your git is correctly formatted (https://dev.azure.com/YourOrgName/Project/_git/......)

12- You will notice a new password window shows up asking for password, Enter the same Token which you used it earlier. Note that this password will be cached. You might get the same window when you Fetch anther repository. That is why we saved the token temporarily.

13- Fetch your repos, it should work now. Congratulations !

14- Do not forget to remove the TEMPORARILY saved token (if you saved it somewhere) which can be stolen and used to access your account. I mean that copy-pasted token.

these instructions worked for me. 

Thank you

This workes perfectly for me, thank you very much!

It works for git authentication, but not for azure devops organization authentication to use the remote account function, to clone a repository, this works only with the old URL:

RemoteAccount.png

Like Derptastic likes this

9- Remove the password cache file called "passwd" in "C:\Users\{YOUR_USER_NAME}\AppData\Local\Atlassian"

 

That file doesn't exist for me.

@Justin_Swenson 

check "C:\Users\{YOUR_USER_NAME}\AppData\Local\Atlassian\SourceTree"

When sourcetree works, it's great. But this is really making me want to choose another tool

Like # people like this

Worked perfectly for me. Followed every step except 3.5
Thank you!

Few years ago I spent few minutes to download, install and start to use this tool.

Now I am spending 2 days to create an account and still is not working. It does not make any sense. 

@IbrahimMD - thanks however that's not working right now on my machine.

@Derptastic  - thanks however whilst I can set up my account correctly, when cloning a repo, it fails to authenticate.

This appears to still a broken feature in at least the windows client.

For Mac, I made it work by using the old domain and my PAT as both username and password.

On Windows this doesn't seem like it works as it always defaults to your devOps username rather than allowing you to use your PAT.

Any suggestions on this?

Really like sourcetree however reconsidering it as a client if this can't be resolved - particularly as this has been a known issue for over a year.

@dagillespie I'm using the windows client and so is everyone in my company - and we got it working for all. Therefore I can't back the statement that the windows client is broken, even if it's an unnecessary pain in the ass to set-up.

As for the second part - AFAIK on the Windows client you are expected to use your DevOps username and use the PAT only as a password. At this point there's not much I can recommend besides double checking the set-up you have as well as your permissions within DevOps itself for the repositories it fails to clone (if you have Read/Write access). I know we occasionally have to double check those, especially for newly created projects. 

Using DevOps username and PAT allows user authentication as a remote account (where the client should have been updated by now to use the new URL) and you can see a list of repos under remote, cloning these still fails as the client authenticates the account with the old style URL and tries to use the new URL for cloning the repo - where authentication fails.

You can however clone a repo, given a URL from DevOps - which is an inconsistent behaviour.

I would consider the client still broken as this is by no means the way that this process was intended to work, isn't straight forward to do and a work around is not a fix to a problem in a piece of software, just a temporary measure.

Like # people like this

It worked for me.

However next repo set-up took the same effort which is absurd!

There is a bug for that topic. Please vote for it, to solve asap:

Authentication fails when using Azure DevOps URL

Thank you

I would suggest this item is not solved.

0 votes

As of 09-October-2020, Sourcetree version 3.3.9 on Windows, this problem can be worked around by configuring the host URL as https://orgname.visualstudio.com and selecting HTTPS as preferred protocol.

Click refresh PAT and provide your domain username and the PAT as password.

Be careful to configure the proxy correctly if you are sitting behind one.

The host url dev.azure.com still does not work !

This helps me create the remote account, but after that I try to access the repo I get an "Authentication failed" error.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Sourcetree

[dev team] Sourcetree for Windows 2019 Preview - Dark Theme

Hi folks, While the full post is over on our blog I'd like to share the dark theme we've got planned for 2019 here directly as well to keep the discussion going.  The ...

3,280 views 19 18
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you