Alex Shefer
Alex Shefer

Reputation: 31

Using Git repository in Azure DevOps from different organization

I have two organization in my Azure DevOps. I need to create a build pipeline in one organization using a git repository from another. For "Get Sources" I've created a connection for "Other Git" and specified my user name/password. Running the pipeline fails:

fatal: Authentication failed for 'https://:@abc.com/abc.Kernel/_git/ABC.Kernel/'

[warning]Git fetch failed with exit code 128, back off 2.662 seconds before retry. Is there any solution?

Upvotes: 1

Views: 3412

Answers (3)

StuartLC
StuartLC

Reputation: 107237

Just to clarify the current answers, from the Azure Portal, when creating a new Pipeline in Organisation A based on a DevOps Git repo in Organisation B.

  • As at time of writing, you need to use an Other Git repo to connect to another Organization B. The Azure Repos Git option seems to be restricted only to the current Organisation A in which the pipeline is to be created.

  • Manually pre creating a service connection between the organisations doesn't seem to be useful, the option to re-use it when setting up the pipeline isn't offered. Instead the service connection is created as per below, with:

    • Git Repo URL is the repo clone URL. I've used the https URL below but presumably the SSH one will also work
    • User name can be anything. I've called it PAT
    • Password / Token is the PAT token you created in Organisation B. I created with full access, but you'll likely want to security trim the PAT to minimal access for what you intend to do (pull, push etc)
  • However one major limitation at time of writing is that new YAML pipelines aren't supported with Other Git, even though this is actually an Azure devops repo (and external Git yaml is supported).

New Service Connection

Upvotes: 0

Alex Shefer
Alex Shefer

Reputation: 31

I've created a security token and used it instead of the password. It worked.

Upvotes: 2

Alex
Alex

Reputation: 41

When it comes the Azure DevOps there are several ways to manage git repositories. First make sure that you are using the source that will get you the result that you expect. Other Git is listed as a "generic" protocol (see supported-repository-types). I would recommend that you use a Service Connection that has read access to the other orgaization.

If you really want to use "Other Git", you will have to make sure you enable access to the repo from the organization's settings page. see change-application-access-policies

Upvotes: 1

Related Questions