As you mentioned, when using the ADF REST API to retrieve logs, metrics, or data like activity runs, the responses are paginated and typically include a continuationToken which must be manually included in subsequent API calls to retrieve additional pages of data.
To handle it, you generally need to implement a loop within your code to check for the presence of a continuationToken and then make additional API requests accordingly. Here’s a basic outline of how you might handle pagination in a scripting or programming environment:
- Make the initial API request to start retrieving data.
- Check the API response for a
continuationToken. - If a
continuationTokenis present, use it to make the next API request. - Repeat steps 2 and 3 until there is no
continuationTokenin the response, indicating that all pages have been retrieved.
Since you mentioned trying to avoid manual looping, if you are using a platform or programming environment that supports asynchronous programming or workflows, you could potentially wrap this process into a more automated, iterative function that manages the pagination logic more elegantly. However, this would still technically involve looping, just abstracted away from the main flow of your code.
Try to watch these videos :