Search code examples
azure-iot-hubazure-iot-sdk

How to implement paging in Azure Iot device twin queries


The azure documentation at https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-query-language says that “Azure IoT SDKs support paging of large results” but I could not find any sample or reference on how to do it.

Does anyone have an idea?


Solution

  • It's based on the REST API POST calls and headers such as x-ms-max-item-count and X-Ms-Continuation , see the following screen snippets:

    query-firstpage

    query-nextpage

    query-lastpage

    as you can see the above last picture doesn't return a continuation header, therefore this page is last one.