Search code examples
azureazure-devopsazure-repos

Is it possible to have an Azure Devops Pipeline pull data from a different project in a different project collection?


My company has many project collections for different teams. I'm running a tools project in its own project collection, but want to pull this data into the other projects to run against their source code.

I seem unable to figure out if you can use the YAML in an Azure Pipeline to pull data from a different project collection repo. I've tried setting up a new source connection to the tools project, but have had no luck being able to check out that data from a different project within a different project collection.

Thanks in advance.


Solution

  • Can you share your configuration? According to the docs, you may:

    1. Create PAT with permissions for source code in the tools project (check selected organizations during creation): Use personal access tokens

    2. Create Azure Repos/Team Foundation Server service connection: Manage service connections

    3. Use it in pipelines: Repository resource definition

      resources:
        repositories:
        - repository: MyAzureReposGitRepository # In a different organization
          endpoint: MyAzureReposGitServiceConnection
          type: git
          name: OtherProject/MyAzureReposGitRepo