How to pass LinkedService parameter value to all dataset in ADF

1k Views Asked by At

I have created a parameter in the linked service of the oracle database connection and would like to get the value of the parameter to all datasets, I have created datasets for each table and would like to get oracleSchemeName parameter from the Linked service, In my scenario schema name will change based on environments, SO I passed schema name as parameter but when I'm trying to read the value of linked service, I am getting error table or view doesn't exist.

Can someone please guide me on how to provide expression here? {@linkedService().oracleSchemaName} --Not working.

Below is the screenshot of dataset

enter image description here

1

There are 1 best solutions below

0
On

{@linkedService().SchemaName} is invalid as schema name is not part of the linked service connection string. You can parameterize the properties which are part of the linked service connection string properties.

Example:

enter image description here

If you want to pass the schema/table name dynamically, you can create a pipeline level parameter and pass the values in run time.

Steps to pass the table schema value dynamically at runtime:

  1. Create a parameter at database level (SchemaName) and do not pass any value to it currently.

enter image description here

  1. Edit the table and pass dataset parameter in add dynamic content.

enter image description here

  1. Create a parameter at pipeline level and add the parameter dynamically in sink properties and do not pass any value to the parameter currently.

enter image description here

  1. While running the pipeline, it will ask to pass value to the pipeline parameter, then pass the value and run the pipeline.

enter image description here

Reference: Parameterize linked services