How to handle pagination with $skipToken in Azure Data Factory

Bartosz Pelikan 41 Reputation points
2023-02-27T20:15:26.1933333+00:00

I'm curious how to handle pagination with $skipToken in Azure Data Factory

According to the documentation (Pagination support) it seems quite simple in case when we have @odata.nextLink to use as next URL (Microsoft Graph API), but it's more complicated when it comes with $skipToken, that we need to insert in next POST body (Azure Resource Graph):

POST https://management.azure.com/providers/Microsoft.ResourceGraph/resources?api-version=2021-03-01

{
    "query": "Resources",
    "options": {
      "$skipToken": "eyAibm8iOiAibHVjayIsICJidXQiOiAibmljZSIsICJ0cnkiOiAiISIgfQ=="
    }
}

I thought about Copy activity with Until loop, but I couldn't find a way to grab $skipToken from previous activity.

Is there any simple solution for that or any workaround?

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

1 answer

Sort by: Most helpful
  1. Richard Swinbank 522 Reputation points MVP
    2024-02-14T10:27:59.7833333+00:00

    You can't reference one Until iteration from the next, but could you store the skip token in a pipeline variable at the end of each iteration? The variable would always hold the latest skip token, ready for use in the next iteration.

    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.