Azure Storage: count blobs using JAVA SDK

Anonymous
2021-11-23T10:21:38.287+00:00

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.
1,403 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 23,666 Reputation points Microsoft Employee
    2021-11-23T22:05:09.517+00:00

    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.