Raas Masood
Raas Masood

Reputation: 1565

how to pass variables to Azure Data Factory REST url's query stirng

i am new to Azure data factory. I have a source dataset that is linked to a REST api. The url of this API has a query string. I have an activity that copy data from REST to Database. But i have to pass different values in query string and run the same activity against different values. How can this be done in Azure Data Factory?

enter image description here

i kind of reached here. but how to pass the value of this "HospitalCode" ?

Upvotes: 5

Views: 6477

Answers (1)

Steve Johnson
Steve Johnson

Reputation: 8660

Please try something like this:

1.create a pipeline and set a variable(your HospitalCode):

Name:CodeArray Type:Array DEFAULT VALUE:["01","02"]

2.create a ForEach Activity:

Items:@variables('CodeArray')

3.create a Parameter name is code,type is String.

Setting of Linked service like this: enter image description here dynamic content:@concat('pjjs/pls?HospitalCode=',dataset().code)

4.Setting of Copy Activity's Source enter image description here

Hope this can help you.

Upvotes: 8

Related Questions