I'm trying to enable/disable multiple pipelines based on a condition, would like to create a pipeline that takes the parameter from the user and updates all the other pipelines.
I've found these below documents from Microsoft
https://learn.microsoft.com/en-us/rest/api/azure/devops/pipelines/pipelines?view=azure-devops-rest-6.0
https://learn.microsoft.com/en-us/cli/azure/ext/azure-devops/pipelines?view=azure-cli-latest
but I'm not able to find anything for enabling/disabling a pipeline, is there any way of doing this in any other ways?
You can use the REST API Definitions - Update to enable or disable pipelines.
For its request body, you need to get the definition of the build using the GET REST API first:
Use the response body of GET REST API as the request body of PUT REST API. And then modify the value of
queueStatus
according to your requirements.If you want to enable the pipeline, set the value of
queueStatus
toenabled
; If you want to disable the pipeline, set the value ofqueueStatus
todisabled
.