Azure Storage: count blobs using JAVA SDK


Hi all,

my question regards Azure Blob Storage and JAVA SDK

I am looking for a quick solution for getting number of blobs from a specific folder. Unfortunately, I didn't find any method / function or REST API for getting it.
The most common approach uses listing blob and count items, but its not a efficient ways for folders that contains hundred thousands blobs...

Do you know better approach? Is this functionality available in JAVA SDK / REST API ? Another approaches which use other azure services are welcoming...

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,427 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 33,296 Reputation points Microsoft Employee

    anonymous user The easiest non programmatic method is to navigate to the folder in Azure Storage Explorer and select folder statistics. This will provide the number of blobs and size. You could also setup Azure Storage blob inventory. Which would allow you Calculate blob count and total size per container. Alternatively you can use the method you already mentioned. Here is a StackOverflow thread with some samples and discussion that you might find helpful.

    Hope this helps! Let us know if you have further questions or run into any issues.


    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.