Multiple hosting accounts with the same username

Luke Lane
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 7, 2022

I am trying to configure SourceTree to connect to multiple Git repositories that are hosted under different Organizations in Azure DevOps. I access both organizations using the same Azure Active Directory account.

 

I can successfully add a Hosting Account with a Personal Access Token for the first organization, for example:

Tools > Options > Authentication > Add

Hosting Service: Azure DevOps

Host URL: https://dev.azure.com/[OrganizationA]

Preferred Protocol: HTTPS

Authentication: Personal Access Token

Username: [myemail]@[mycompany].com

Password: [PAT_A]

 

I try to add a second Hosting Account using the same settings as above, but with the following fields different:

Host URL: https://dev.azure.com/[OrganizationB]

Password: [PAT_B]

But I get the following error:

An account already exists for '[myemail]@[mycompany].com@dev.azure.com'

 

This looks like a limitation in SourceTree that it cannot support multiple accounts with the same username and root URL.

 

I tried manually editing the file C:\Users\[username]\AppData\Roaming\Atlassian\SourceTree\accounts.json but couldn't get it working - although I could see both accounts in the Authentication settings and set the correct PAT for each one, I don't think the rest of the app knows how to choose the correct account and I got authentication errors.

 

I am on Windows 10 Pro x64 21H2 using SourceTree 3.4.7 (Enterprise installer)

1 answer

0 votes
Baptiste MARZET
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 30, 2022

Hello,

I had the same issue here. I did a hacky thing to be able to connect to multiple organisations: Azure DevOps still support old organisation URL from visual studio time.

So instead of using https://dev.azure.com/[OrganizationA] and https://dev.azure.com/[OrganizationB], use https://[OrganizationA].visualstudio.com/ and https://[OrganizationB].visualstudio.com/ URL as host. And sourcetree will be happy with this as domain is different.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events