I would like to understand differences of both APIs.
Azure Devops provides Classic UI builds and Yaml build pipelines. These two APIs can both start a pipeline run (No matter Classic UI Build pipeline or Yaml Build pipeline). The biggest difference between the two APIs exists in their Request Body
:
1.You should know that Yaml pipeline has introduced an important function Runtime parameters. We can pass variables and parameters when using Run pipeline API
, but we can only pass variables when using Builds-Queue
API.
The new Run pipeline
API coming after api-version 6.0
supports passing parameters/variables which are important for Yaml pipelines. But the old Queue-build
doesn't support parameters, it only support variables (The parameters here is actually variables, it's not real parameters for YAML).
2.What's more, we can use normal yaml pipeline for both CI and CD. It's multi-stage Yaml pipeline. To run such pipeline, it's strong recommended to use Run pipeline
.
Check the Request Body of Run pipeline
carefully and you'll find the Run pipeline
is more related to Yaml pipeline. The StagesToSkip
element and yamlOverride
are unique functions for YAML pipeline.
When to use what?
Chose Run pipeline for YAML pipeline and chose Builds-Queue for Classic UI Build pipeline. It's not necessary (both these two APIs can start Classic Build run and Yaml Build run) but it's more recommended.