How to search Azure DevOps pipelines

Viewed 197

We have some steps in Azure DevOps pipelines that need to be refactored, essentially a lot of copy/paste code that calls a bash script. We would like to move the copy/paste code into the bash script (easily done), but the step is repeated many times in many pipelines. Therefore, any clean up we do has to be repeated for every instance to be effective.

Is there a way to search pipelines which are not YAML-based and stored in a repository? Searching either the definitions or the output would allow us to get an inventory of everything to change.

2 Answers

Searching for pipelines is not supported out of the box on Azure DevOps. Currently you can search for types shown below:

enter image description here

You may read that you can search for Azure Repos, Pipelines, Test Plans, or an Artifacts page for a project: automatically displays functional filters for code searches.

This search will only search inside a project for files/code with the specific name. First things first you should enable new settings search from preview features.

enter image description here

Given that I have created a pipeline named cron on my test-project (Azure devops project) I can search inside this project for cron, but this search will output only the files that include the cron keyword and not the actual pipeline.

Searching inside a project for cron

enter image description here

Results of the search

enter image description here

For more info, you can refer to Search FAQs.

You can search your ADO pipelines and inventory the things you need to change using the search setup tool ExportPipelineDefinitions.

The tool exports all your ADO pipelines, both YAML and non-YAML, to your local drive. They are saved as .yml files and as .json files respectively. In a single operation it finds and exports all pipelines in all ADO projects to which you have access.

This makes all your pipelines searchable at once using "Find in Files" in Visual Studio, VS Code, or other text search tool.

https://github.com/BruceHaley/ExportPipelineDefinitions

Related