Search code examples
azurepaginationazure-storageazure-blob-storageazure-rest-api

List Blobs in Container having 1000+ (large number of files). [AZURE-STORAGE][REST]


I am trying to make a get List of Blobs in a Container REST call to my Azure storage account. Currently, I have a limited number of files and the response that I get is in the following format as specified in official doc.:

enter image description here

But if there are 1000s of files in this container the response will be huge will it still be in the following XML format or will there be any pagination or paging? I can't practically test it for 1000 files and there is no such thing mentioned in the docs here. Link


Solution

  • Simple answer to your question is yes. Maximum number of blobs that can be returned in a single list blobs request is 5000 (it can be less than that and even zero).

    If more blobs are available, then you’ll get a continuation token which you can use to fetch next set of blobs. This continuation token can be found in element in response body.

    For further reference, please see this link: https://learn.microsoft.com/en-us/rest/api/storageservices/enumerating-blob-resources.