Recently I had to implement a pagination mechanism for usage with Azure CosmosDB and Azure Functions on .NET Core 3.1.
After stumbling upon several issues like f.e.:
- Partition key ranges were not taken into respect
- Pagination links were hard to setup
- URL Encoding continuation tokens
- Parsing URL query parameters into SqlQuerySpec
I’ve published following repository on GitHub:
The function is setup in C# using .NET Core 3.1 on Azure Function Apps.
An example call could look as follows:
GET http://localhost:7071/api/storage/collection?q={ "QueryText": "SELECT * FROM c", "Parameters": [] }&pageSize=2