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

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?

 

12 answers

1 accepted

Edit: (as of 24.03.2021) The issue is reported as resolved  - see https://community.atlassian.com/t5/Sourcetree-questions/Azure-DevOps-with-Sourcetree-Adding-a-remote-account/qaq-p/1065001#M38503

Please give this a go, before trying the workaround!

 

 

Workaround:

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

https://dev.azure.com/{orgName}

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

https://{orgName}.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. 


Edit: 
As of 28.01.2021 the issue is still ongoing, and I see more people are finding the answer here. There is an open bug report on it (as Christian Wölke pointed out quite some time ago) that seems to be getting some slow progress, but a bump could help reminding them that it's still an active issue: https://jira.atlassian.com/browse/SRCTREEWIN-10800?workflowName=SourceTree+Bug+Workflow&stepId=8 

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.

EDIT: v3.4.4 - Spring 2021
The Azure integration seems to be working okay now. I added a new account to Authentication and used the built-in Azure option and the `https://dev.azure.com/OrgName` URL for the Host. The only flaky part was actually clicking the button to activate the Personal Access Token; I had to make sure the Host URL field didn't have focus (I clicked every field in order, top to bottom to make the PAT button work). It popped up a login field; I entered my email as user name and the PAT password as my password and after a while it came back Authenticated.  
  
I can use this to add my repos as remotes and my old, carry-over authentication still works for old repos.

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

Well, The bug is still here and the solution worked for me in December of 2020.

Like Stephan Geissbühler likes this

Worked for me 21/12/2020,

Like Stephan Geissbühler likes this

Same for me 22/12/2020

Like Stephan Geissbühler likes this

Even in 2021 it's still the way to go :D

Like Richard Davis likes this
albstr I'm New Here Aug 19, 2021

This worked for me half the way, was able to add account but not pull/push code to new dev.azure.com  adresses...

lucasda2 I'm New Here Aug 26, 2021

@albstr I had the same exact problem. I found Andrzej's solution here, and everything now seems to be working for me:

1) remove all "remote accounts" for that server (well, I wasn't even able to create one)

2) Switch SourceTree to "system" git in Tools -> Options -> Git -> Git Version (at the bottom)

3) Close SourceTree

4) Reinstall GIT with an option "Git Credential Manager Core" enabled (!)

5) Start SourceTree

6) Clone repo and there should be an external modal dialog for authentication to the TFS. Just use normal credentials. No need for external account setup.

For me, step 2 was all I really needed, and suddenly everything worked.

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!

Thank you  very much. Finally this solution hot worked.

albstr I'm New Here Aug 19, 2021

This actually worked!! Many thanks!

I would suggest this item is not solved.

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

Authentication fails when using Azure DevOps URL

Thank you

I am, unfortunately, unable to confirm for the time being, has anyone else been able (at latest SourceTree version) to authenticate using: https://dev.azure.com/{orgName}

@Derptastic Do you have version 3.4.3?
I have tested it succesfully, also all my collegues have confirmed that the authentication works.

SNAG_20210329_073847.png

@Christian Wölke Apologies, I was unclear. My comment wasn't because the solution is not working for me, the reason is much more trivial - I have since stopped working for the company I was using the account with, and I don't have a personal AzDo account to verify the solution personally, hence my question. 

My solution:

1) remove all "remote accounts" for that server (well, I wasn't even able to create one)

2) Switch SourceTree to "system" git in Options

3) Close SourceTree

4) Reinstall GIT with an option "Git Credential Manager Core" enabled (!)

5) Start SourceTree

6) Clone repo and there should be an external modal dialog for authentication to the TFS. Just use normal credentials. No need for external account setup.

Thank you!

This is the only thing that has worked and I have been trying for over a year to solve this problem!

Like lucasda2 likes this
lucasda2 I'm New Here Aug 26, 2021

Agreed, the embedded Git that shipped with Sourcetree seems to be the root cause of my issues. As soon as I switched to the newer Git on my system, everything immediately started to work.

1) Create PAT at DevOps, copy off the token

2)*** Clear the CACHE *** OSX: /Users/rlew/Library/Application Support/SourceTree

3) Set up the account in SourceTree with https://orgname.visualstudio.com like everyone else

4) Celebrate!!... then dry cry that I just lost 3 hours of my life on step #2

Thanks buddy! 

0 votes
SRB1981 I'm New Here Sep 14, 2021

I give up, I'll find another tool.

I configured Visual Studio 2019 with Azure DevOps in a few minutes, and now I've spent too much time trying to configure SourceTree. The login with PAT is okay, but when I try to Pull from repository it fails.

Even if I found a workaround, I would consider this software unreliable because tomorrow it could give other troubles. Have a nice life.

 

PS: computer programs are meant to make our lives easy.

Right after I posted a solution to my problem last year (Feb 2020), I abandoned ST last year and paid for Fork @ fork.dev. Works with Azure DevOps and github. None of this nonsense. Worth a small bit of money to save my sanity.

0 votes

There are no answers on how to deal with in house DevOps. If you have this setup here is a suggestion -

- Make your Master branch the branch that requires a pull request

- Push your local changes to the relevant branch on your DevOps server

- Use Devops to create the Pull Request into Master

- Continue using SourceTree :-) 

I had thought this was a show stopper but this is a simple workaround, arguably not even a workaround.

0 votes
balyan10 I'm New Here May 14, 2021

It worked like charm. Issue persists as of today.

You are amazing. Nothing else worked. And this worked like a charm. you saved my day .

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
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

5,692 views 4 12
Read article

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