ADF - Reset a pipeline parameter in one of the activities of the pipeline

Kothai Ramanathan 941 Reputation points Microsoft Employee
2020-09-03T09:24:56.183+00:00

I want to reset the value of the pipeline parameter in the pipeline. How can I go about doing this ?

I have a scenario where one pipeline triggers a run of the child pipeline. Later it gets the status of the child pipeline by calling the rest API. I see that the parameters of the child pipeline are also returned in the status call. Hence looking at this as a way to return some value from the child pipeline to the called pipeline (through the parameters)

Thanks,
Kothai.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,662 questions
0 comments No comments
{count} votes

Accepted answer
  1. MartinJaffer-MSFT 26,036 Reputation points
    2020-09-03T17:56:27.327+00:00

    Hello @Kothai Ramanathan and thank you for your question. Pipeline parameters are meant only for use as inputs to pipelines. Once a pipeline is running, pipeline parameters are read-only. This makes them unsuitable for returning values.

    Do not worry, it is still possible to retrieve values. You were very very close. While parameters are read-only, variables are writable.

    Instead, I suggest adding a SetVariable activity to your pipeline, where you set the value you want to retrieve. Then you can use the rest API to query activityRuns for that pipelineRun. Then you can retrieve the value from the set variable activity.

    As example, I created a trivially simple pipeline with 1 parameter and 1 variable, and 1 set variable activity assignign the parameter to the value.

    Then in Postman, I did a post call to
    https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/pipelineruns/{runId}/queryActivityruns?api-version=2018-06-01

    22581-image.png

    Please let me know if this helps or if you have more questions.

    Thank you
    Martin


0 additional answers

Sort by: Most helpful