1
votes

I'm trying to run a pipeline from an Azure DevOps hub extension, using the azure-devops-extension-api.

The azure-devops-extension-api (GitHub repository) contains several rest client classes, such as the BuildRestClient class and the ReleaseRestClient class. Both of which I've successfully used methods from.

However, the azure-devops-extension-api doesn't contain any rest client class for the Runs - Run Pipeline Azure DevOps Services REST API. I'm suspecting that this is because this endpoint is new for the 6.0 version of the API, and so it hasn't been implemented in the azure-devops-extension-api yet

Is there any way that I could use this azure-devops-extension-api to run a specified pipeline? Perhaps via the queueBuild method? I want to run a specific pipeline though, not a specific old build.

Any input would be appreciated!

2

2 Answers

0
votes

Yes, if you want to use azure-devops-extension-api to run a specified pipeline, you can use queueBuild method.

Regarding the sourceBuildId parameter, there is no specific description in the document, I will add it here.

sourceBuildId: The source build must be a pull request build if queueing with sourceBuildId.

0
votes

What I ended up doing, was creating my own PipelineClient class (from the Runs - Run Pipeline), which extends the RestClientBase from the azure-devops-extension-api/Common/RestClientBase.

Thankful for the input I got to this question, it's appreciated!