question

gauravgupta-9912 avatar image
0 Votes"
gauravgupta-9912 asked ShaikMaheer-MSFT commented

Dynamic host name for REST connector in Azure Data Factory

Hi,

I would like to hit a bunch of APIs which has the same response format/structure. They differ only in base URL - for example

  1. https://domainA.com/cds-au/v1/users

  2. https://domainB.com/cds-au/v1/users


Is there any provision to use a RESTful connector in this scenario?

I have through this screencast which demonstrates the use-case might be satisfied using Web connector, but I am more inclined towards a dedicated connector for RESTful web service.



azure-data-factory
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

ShaikMaheer-MSFT avatar image
0 Votes"
ShaikMaheer-MSFT answered ShaikMaheer-MSFT commented

Hi @gauravgupta-9912 ,

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

If you would like to hit API using web activity:
Use dynamic expression inside your web activity URL filed as shown below. In below, example I created a baseURL parameter and that parameter I am using inside web activity URL field dynamic expression

112031-webactivity.gif

If you would like to create REST Dataset:
You can parameterize REST linked service inside REST type of dataset as shown below. Gif shows a dataset type of REST Type with parameterized REST type linked service

112022-restdataset.gif

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



webactivity.gif (1.9 MiB)
restdataset.gif (2.7 MiB)
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@ShaikMaheer-MSFT

This helped.

Though I am planning to populate the URLs from the CSV or json file and call the web service in a loop. So the json file should look like:

 [
   {
     "url": "domainA"
   },
   {
     "url": "domainB"
   }
 ]


Can you help me with a resource where I can learn more about expression.

0 Votes 0 ·

Hi @gauravgupta-9912 ,

I am glad that above answer helps. Please Accept Answer that will help community as well.

Thank you for follow up query. Yes, above mentioned format works fine. Below are the steps to proceed.

Step1: Use lookup activity and get URLs from your csv or json file(uncheck first row only check box inside lookup)

Step2: Pass Value array from lookup activity output to ForEach activity.

Step3: Inside ForEach activity use your API calling activities as discussed in above answer.

Hope this helps. Please let me know if any further queries. Thank you.

0 Votes 0 ·