Passing SQL file as a parameter to source dataset in ADF

Purushottam Uppu 21 Reputation points


I am using a SQL query to connect to Oracle database in my source dataset. But the query is a dynamic in nature and any changes to the query would end up modifying the query in source dataset and publish.

To avoid this, we wanted to place the query in a .sql file as a file and call this during ADF execution.

Is it possible? Appreciate your response.


Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
7,971 questions
{count} votes

Accepted answer
  1. ShaikMaheer-MSFT 34,536 Reputation points Microsoft Employee

    Hi @Purushottam Uppu ,

    Welcome to Microsoft Q&A Platform. Thank you for posting your query here.

    Please check below detailed explanation of implementing same.

    Here, I am having my SQL query in "Query.sql" file on blob storage. Reading data from that "Query.sql" file using lookup activity. Using lookup activity output in copy activity query field dynamically.

    Step1: Query.sql file in my blob storage

    Step2: Lookup activity in pipeline to get our SQL query from file on blob

    Step3: Lookup activity output json shows our SQL query from file.

    Step4: Copy Activity. In Source using query option and dynamically running our query from lookup activity output.

    Hope this will help. Thank you


    • Please accept an answer if correct. Original posters help the community find answers faster by identifying the correct answer. Here is how.
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification

0 additional answers

Sort by: Most helpful