I am relatively new to Azure DevOps. I am documenting the pipelines that currently exist within Azure DevOps and there are hundreds of them. Is there a way to export the names of all of the pipelines and potentially any other information about them (like pipeline description or environment) into an excel or something similar? I have read only access. I have not been able to figure out an easy way to do this and I feel like there must be a better solution than manually copying them one by one.
I’ve looked through questions on stack overflow but none seemed to answer this specific question.
2
Answers
REST
Depending on the technology you want to use you can use the for example the REST api of Azure DevOps, for YAML pipelines:
https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines/list?view=azure-devops-rest-7.0
For the classic pipelines:
https://learn.microsoft.com/en-us/rest/api/azure/devops/release/definitions/list?view=azure-devops-rest-7.0&tabs=HTTP
PowerShell
Or using PowerShell with VSTeam, check out the Getting started here.
For (YAML) build:
https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamBuildDefinition
Get-VSTeamBuildDefinition -ProjectName Demo | Format-List *
And Classic (release) pipelines:
https://methodsandpractices.github.io/vsteam-docs/docs/modules/vsteam/commands/Get-VSTeamReleaseDefinition
Get-VSTeamReleaseDefinition -ProjectName demo | Format-List *
This result can than easily opened into Excel with
$obj | Export-Excel
:https://github.com/dfinke/ImportExcel
For your scenario, REST API is a good approach.
To get all the pipelines from a DevOps Project, you could use: Pipeline-List
This could list all pipelines including pipeline name and pipeline ID.
You could copy the output into an excel and filter your target info.
With the above pipeline ID, you could use this REST API: Pipelines-Get to retrieve more info related to this specific pipeline by ID.
Variables:
Repo info:
Environments related API are listed here