I'm looking for a way to list all YAML Pipelines "definition" that trigger deployments using the deployment job feature (released in GA in 2020).
In previous Classic Release pipeline, it was easy, you just had to list all existing release definitions pipelines using the release REST API endpoint:
GET https://vsrm.dev.azure.com/{organization}/{project}/_apis/release/definitions?api-version=6.0
I didn't find anything similar with YAML Pipelines.
I tried using the pipelines endpoint (released in REST API version 6.0) to get pipeline information:
GET https://dev.azure.com/{organization}/{project}/_apis/pipelines/{pipelineId}?api-version=6.0-preview.1
Returning this JSON (redacted):
{
"_links": {
"self": {
"href": "https://dev.azure.com/myorganization/19d42339-19ab-0000-aa1c-3f8e53300000/_apis/pipelines/1813?revision=2"
},
"web": {
"href": "https://dev.azure.com/myorganization/19d42339-19ab-0000-aa1c-3f8e53300000/_build/definition?definitionId=1813"
}
},
"configuration": {
"path": "azure-pipelines/CI.yml",
"repository": {
"id": "a5e1ea98-1181-40a0-932f-6fcbdb92b1a0",
"type": "azureReposGit"
},
"type": "yaml"
},
"url": "https://dev.azure.com/myorganization/19d42339-19ab-0000-aa1c-3f8e53300000/_apis/pipelines/1813?revision=2",
"id": 1813,
"revision": 2,
"name": "My YAML Pipeline definition",
"folder": "\\"
}
You get the repository and YAML file used to create this pipeline, but no information about the content. There is no way to know this pipeline is used for deployments.
Using Azure DevOps REST API, is there a way to retrieve more information about a YAML pipeline to be able to know if it will be involved in deployments ?
PS: Downloading YAML files and parsing them to get deployment job references is NOT an option.