Search code examples
azure-data-factory

Embed a parameter into a activity object call


I'm using a json file for reading in config parameters.

{"process_delta":
            {
                "primary_keys": ["id"],
                "schema_name": "schema",
                "table_name": "table",
                "source_path":"folder/table/"
            }
}

Then in my pipeline with a lookup activity I can call the source_path in subgroub process_delta with this:

@activity('Lookup config details').output.firstRow.process_delta.source_path

That works.

My issue is want to make my pipeline nice and generic to enable reuse and some existing pipelines don't have the same name for their sections. Is there a way to put a parameter into that formula so the subgroup can be different and still return the source_path value in it?

so like this:

@activity('Lookup config details').output.firstRow.<something_resolved from_a_parameter_here>.source_path

I've tried this but its not happy with it

@activity('Lookup config details').output.firstRow.@{pipeline().parameters.p_config_section}.source_path


Solution

  • You can do like below.

    @activity('Lookup1').output.firstRow[pipeline().parameters.param1].source_path
    

    Here my param1 value is "process_delta".

    enter image description here

    Result:

    enter image description here