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)
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.