I'm in the process of creating an integration pipeline that should execute build pipelines of dependent projects (as a validation build). All of these projects are hosted in Azure DevOps in their own team project. In order to call the respective pipelines, I thought of using the repository
resource.
According to documentation here and here it should be possible to execute YAML templates from different repositories. The examples show how to use the repository
resource for GitHub-hosted repositories, but it's not very clear how to connect to a different team project hosted on Azure Repos. When hosted within the same team project, it can be done as described within this answer.
I've tried this:
resources:
repositories:
- repository: MyRepoAlias
type: git
name: MyRepo
ref: 'refs/heads/master'
# Adding/omitting an endpoint doesn't matter
endpoint: 'MyRepo Service Connection'
pool:
vmImage: 'windows-2019'
steps:
# Calling template on the reference repository
- template: '.\Templates\RunBuild.yml@MyRepoAlias'
For the record, the reference repo exists within the same AzD organization. And it doesn't matter if I add the 'endpoint' property to the endpoint. In this case I've linked it to a 'Azure Repos/Team Foundation Server' type service connection using token-based authentication with a full-access PAT.
Questions:
- Anyone got an idea how to reference a Azure Repos-hosted Git repository from a different team project in YAML?
- Maybe some alternative ways to chain pipelines together in AzD?