how to perform pagination in azure data factory using Rest API?

Navdeep Kaur 21 Reputation points
2021-01-19T10:14:06.11+00:00

Can you please share in detail with steps.

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
9,656 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Saurabh Sharma 23,751 Reputation points Microsoft Employee
    2021-01-19T20:26:55.897+00:00

    @Navdeep Kaur Thanks for using Microsoft Q&A !!

    Can you please share what kind of pagination you are trying to implement ?

    If your API response contains a property that points to the next page url then it can be used to load the next page using the "AbsoluteUrl" key in the pagination rules page in your ADF. As mentioned in the example Facebook Graph API returns response in the below structure:
    { ...
    "paging" : {
    "previous": "https://graph.facebook.com/me/albums?limit=25&before=NDMyNzQyODI3OTQw",
    "next": "https://graph.facebook.com/me/albums?limit=25&after=MTAxNTExOTQ1MjAwNzI5NDE="
    }
    }
    so your pagination rule will look like below:
    58189-image.png

    If you are using a Microsoft Graph API like https://graph.microsoft.com/v1.0/users then Microsoft Graph returns the next url as "@odata.nextLink" in the body as shown below :
    58215-image.png

    You pagination rule will be something like below:
    58146-image.png

    Please refer to the official documentation to get the supported pagination rules:

    • Next request’s absolute or relative URL = property value in current response body
    • Next request’s absolute or relative URL = header value in current response headers
    • Next request’s query parameter = property value in current response body
    • Next request’s query parameter = header value in current response headers
    • Next request’s header = property value in current response body
    • Next request’s header = header value in current response headers

    You can also refer to documentation to get more on using REST in copy data.

    2 people found this answer helpful.