Queueing Azure DevOps Pipelines from Logic Apps

Queueing pipeline execution in Azure DevOps is fully possible in several ways. The reason to do it is to orchestrate running a couple of pipelines to automate manual steps in a larger context. In this post I focus on doing it from Logic Apps Consumption using the Azure DevOps connector. Just starting a pipeline with no parameters is straight forward. Add the Queue a new build action, create the connection, fill in the required information and you’re ready to go.

Azure DevOps Queue a new build action in Logic Apps

If your pipeline has some parameters that you need to fill if you run interactively things get a bit more complicated and you need to understand how data flows in your pipeline. First of all your parameters need to have a default value, without defaults your pipeline fails.

Example of parameters when you run the pipeline interactively.

From your Logic App you can send a JSON dictionary with the values you want to use in the pipeline. With the example in the image, you will have available in your pipeline the values using the syntax $(keyName) three parameters.

Input JSON from the Logic App.

Nice but to get things working nicely being able to start your pipeline interactively and from your Logic App we need to bind the incoming values to the parameters you have in the pipeline. You can do this by setting the default value for the parameters.

Parameters section in the pipeline definition.

In the rest of your pipeline always use the normal syntax ${{parameters.%name%}} that way the pipeline will use the right values regardless of if you start from your Logic App or interactively. The picture below shows how data flows from your Logic App into the parameters and then used in the tasks.

Show data flow from the JSON into the parameters and the used in tasks.

Hope this give you a better understanding how you can start your pipelines with arguments and how the data can flow.

Additional reading:

Azure DevOps – Connectors | Microsoft Docs

Use runtime and type-safe parameters – Azure Pipelines | Microsoft Docs

Some more on using the connector Automating Azure DevOps with Logic Apps – Simple Talk (red-gate.com)

Author: Samuel Kastberg

Integration consultant working as Customer Engineer at Microsoft Sweden. My opinions only, most certainly not necessarily those of my employer.

One thought on “Queueing Azure DevOps Pipelines from Logic Apps”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s