Convert Python api call to Data Factory Activity and pull data

Krishnamohan Nadimpalli 406 Reputation points
2023-03-29T13:58:51.99+00:00

Following code is used to get data from an API. When I am running following code through jupyter notebooks, it brings the data. But I want to implement the same in Data factory. Not sure how parameters are passed and which activity to use(Rest or Http or Web). Please suggest on this.

User's image

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

1 answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,642 Reputation points Microsoft Employee Moderator
    2023-03-29T21:13:21.4966667+00:00

    Hi @Krishnamohan Nadimpalli ,

    Thanks for using Microsoft Q&A forum and posting your query.

    As per my understanding, you would like to get from a REST API with query parameters to filter data using Azure data factory. Please correct me if my understanding is wrong.

    For your requirement, you can use Web activity to get the data and pass query parameters using pipeline variables or pipeline parameters as discussed in the SO thread - Where to specify REST API parameter for GET method in ADF Web Activity

    For example as below:

    enter image description here

    enter image description here

    In case if you just want to get the data and map few fields from the API response to your desired sink then use REST connector in COPY ACTIVITY Source

    Please refer to this thread for more info on how to use REST for passing query parameters. You can declare pipeline variables or parameters for API parameters and use them in relative URL as above using dynamic expression.

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

    An advantage of REST connector is that you can configure pagination rules in case if your API returns result in pages.

    Hope this info helps.


    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.