I intend to build a activity that can be plugged in anywhere, and based on the flow its plugged in, it reports its predecessor and details to a sql table.
Have tried a few options, but nothing seem to let me use the dependsOn property Or find the predecessor of the current activity any other way.
What could I be missing ?
I tried using @pipeline.pipeline.activities
– some documentation seems to suggest that it will work, but ADF doesnt recognize it. Similarly, @activities
is suggested someplaces, but its not recognized by ADF
1
I do agree with @Joel Cochran that currently there might not be any ADF dynamic expression for the activity names. If you are triggering the pipeline, you can try the below workaround. But this requires another parent pipeline and it will only gives the about the activities of the required pipeline only after its pipeline run.
Take a parent pipeline with an execute pipeline activity and add your pipeline to that and check on Wait on completion in the activity. Upon completion of this activity, take a web activity and use REST API Activity Runs -Query By pipeline run to get the details of the activities using the child pipeline run id.
Give the details for the web activity like below.
https://management.azure.com/subscriptions/<subscription_id>/resourceGroups/<Resource_GP_name>/providers/Microsoft.DataFactory/factories/<Data_factory_name>/pipelineruns/@{activity('Execute Pipeline1').output.pipelineRunId}/queryActivityruns?api-version=2018-06-01
Add your triggers to this pipeline and upon the triggering the pipeline, the web activity output will give the details of the activities of the child pipeline as an array of JSON.
After web activity, you can use this JSON array in a script activity or a copy activity with openjson()
to copy the required fields into your SQL table.