Search code examples
azurerestazure-storageazure-table-storage

Cant get all items from Azure Storage Table


I cant get more that 1000 items from a Azure Storage Table. Ive tried adding these headers as per this link:

OData-MaxVersion: 4.0  
OData-Version: 4.0  
Prefer: odata.maxpagesize=3 

Ive also looked for a returning @odata.nextLink property to get next page of items but none is returned. The table has around 2050 items.


Solution

  • This is by default and has been added for performance optimization.

    A query against the Table service may return a maximum of 1,000 items at one time and may execute for a maximum of five seconds. If the result set contains more than 1,000 items, if the query did not complete within five seconds, or if the query crosses the partition boundary, the response includes headers which provide the developer with continuation tokens to use in order to resume the query at the next item in the result set. Continuation token headers may be returned for a Query Tables operation or a Query Entities operation.

    See Query timeout and pagination on how to use continuation token headers to get the next set of results.

    One important extra piece of information:

    A request that returns more than the default maximum or specified maximum number of results returns a continuation token for performing pagination. When making subsequent requests that include continuation tokens, be sure to pass the original URI on the request. For example, if you have specified a $filter, $select, or $top query option as part of the original request, you will want to include that option on subsequent requests. Otherwise your subsequent requests may return unexpected results.