Pagination in ADF using REST API giving duplicate entries

Neeraj Chimwal 11 Reputation points
2022-06-28T15:40:29.827+00:00

Hi
I have an API end point that gives 300 records per page and contains an absolute URL for next page
I am using copy data activity with 'AbsoluteURL' pagination rule and it's value $['nextLink'].
The pipeline works for few APIs but for some APIs, it imports same page again and again. This causes it to dump duplicate data in database (my sink).

Is there any solution for this?

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

1 answer

Sort by: Most helpful
  1. AnnuKumari-MSFT 34,556 Reputation points Microsoft Employee Moderator
    2022-06-29T11:33:21.097+00:00

    Hi @Neeraj Chimwal ,

    Thankyou for using Microsoft Q&A platform and thanks for posting your query.

    As I understand your ask you are trying to copy the data from REST API to database, however, it is leading to duplicates in the target as even after implementing pagination , it's returning same page records sometimes. Please let me know if my understanding is incorrect.

    Generally, this is not expected , implementing $['nextLink'] should return next page records. But as in your case, you are getting duplicate data . To avoid getting duplicate record in the target , you can try following approaches:

    Hope this will help. Please let us know if any further queries.

    ------------------------------

    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you.
      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
    • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators

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.