Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Data Factory v2: Activity execute pipeline output

Is there a way to reference the output of an executed pipeline in the activity "Execute pipeline"?

I.e.: master pipeline executes 2 pipelines in sequence. The first pipeline generates an own created run_id that needs to be forwarded as a parameter to the second pipeline.

I've read the documentation and checked that the master pipeline log the output of the first pipeline, but it looks like that this is not directly possible?

We've used until now only 2 pipelines without a master pipeline, but we want to re-use the logic more. Currently we have 1 pipeline that calls the next pipeline and forwards the run_id.

like image 840
Johannes Vink Avatar asked Nov 21 '18 12:11

Johannes Vink


People also ask

What is execute pipeline activity in Azure Data Factory?

The Execute Pipeline activity allows a Data Factory or Synapse pipeline to invoke another pipeline.

How can we get output parameter from executed pipeline in ADF?

You can use the Azure REST API to query activity runs, so you could do an API call to get the last pipeline run of the pipeline you are interested in. Then you use those details to call another REST API to get the Activity output for that pipeline RunID you are interested in.

Can Azure Data Factory pipeline execute other pipelines?

You can Invoke Azure Data Factory Pipeline from another pipeline. Azure Data Factory is a fully managed, cloud-based data orchestration service that enables data movement and transformation. Executing the ADF pipeline from another data factory pipeline is quite useful.

How do you pass output from one pipeline to another in Azure Data Factory?

Come back to the pipeline one (execute-pipeline-demo-1) from which we want to call the second pipeline (execute-pipeline-demo-2). Go to the activity search box and type execute. You will see the execute pipeline activity in the bottom result pan, drag and drop this execute pipeline activity to the Designer tab.


2 Answers

ExecutePipline currently cannot pass anything from its insides to its output. You can only get the runID or name.

For some weird reason, the output of ExecutePipeline is returned not as a JSON object but as a string. So if you try to select a property of output like this @activity('ExecutePipelineActivityName').output.something then you get this error:

Property selection is not supported on values of type 'String'

I found that I had to use the following to get the run ID: @json(activity('ExecutePipelineActivityName').output).pipelineRunId

like image 78
Jason Welch Avatar answered Sep 19 '22 17:09

Jason Welch


The execute pipeline activity is just another activity with outputs that can be captured by other activities. https://docs.microsoft.com/en-us/azure/data-factory/control-flow-execute-pipeline-activity#type-properties

If you want to use the runId of the pipeline executed previosly, it would look like this:

@activity('ExecutePipelineActivityName').output.pipeline.runId

Hope this helped!

like image 35
Martin Esteban Zurita Avatar answered Sep 19 '22 17:09

Martin Esteban Zurita