RobertM
RobertM

Reputation: 13

Dynamically changing Linked Services/Datasets in Azure Data Factory

We require the ability the to perform a lookup into a config table that will let us know the Server and Database and allow us to change it for subsequent lookups. I can set it up so it up dynamically where it prompts me for the Server and Database – but that process wouldn’t work for us as this process will be running unattended.

For the purposes of this discussion, assume we have a table, Config, which looks like:

ID Server Database 1 A POC1 2 B POC2 3 V POC3

And I use a Lookup function in ADF which contains the query: select Server, Database from Config where id = 1

I then will get the results from this query to set the Server and Database in the Linked Service and Data Set so that I can issue another lookup such as

Select bank_name, bank_etl, bank_rules from bank_table (in the server/database I just looked up in the Config Table) - and continue along with the rest of the ADF process

Upvotes: 1

Views: 1963

Answers (1)

Steve Johnson
Steve Johnson

Reputation: 8660

You can try to use Switch activity.According to the Server Database in the Lookup activity's output,execute different activity.

Below is my test pipeline.

enter image description here

Setting of Switch:

enter image description here

You need to create source dataset before so that the second Lookup activity can use it as source.

Upvotes: 1

Related Questions