2

I do see two options to run a Azure devops pipeline

  1. run pipeline - > https://docs.microsoft.com/en-us/rest/api/azure/devops/pipelines/runs/run%20pipeline?view=azure-devops-rest-6.0
  2. Build queue - > https://docs.microsoft.com/en-us/rest/api/azure/devops/build/builds/queue?view=azure-devops-rest-6.1

I would like to understand differences of both APIs and when to use what?

Rathna
  • 33
  • 4

1 Answers1

2

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.

enter image description here

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.

LoLance
  • 18,434
  • 1
  • 12
  • 39
  • 1
    "Yaml pipeline has introduced an important function Runtime parameters" **introduced** is a tad disingenuous as there is no functional difference between the existing variables that are settable at queue time or during the build process and what you are describing as runtime parameters. I really wish you guys would try to pay more attention to the awesome things that you have already built and add more capabilities to them than with all this "lets make a 4th (maybe 5th) build system for tfsdevopscloudserver" that is worse (yaml) or just differs in name and delivers no more function than b4 – StingyJack Sep 22 '20 at 17:18