question

katsukichi-7111 avatar image
0 Votes"
katsukichi-7111 asked SumanthMarigowda-MSFT rolled back

In azure-blob-storage javascript sdk, how can I get the total byte size of blobs inside a folder?

Azure Storage Explorer allows you to publish folder statistics.

198533-image.png

What we want to achieve is to calculate the total capacity in bytes of all the blobs in the folder (not actually the structure of the folder).

You can accumulate the size by repeating the list with listBlobFlat, but
In this way, in the case of many blobs, it is expected that the load will be severe.

It asks if there is an api or sdk function to get the capacity of the folder through prefix. I am requesting this because I think that the function in the storage explorer is not likely to be handled as a simple iteration, and the function is attached internally.


198504-image.png


azure-blob-storage
image.png (11.6 KiB)
image.png (3.9 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

SumanthMarigowda-MSFT avatar image
0 Votes"
SumanthMarigowda-MSFT answered SumanthMarigowda-MSFT edited

@katsukichi-7111 Firstly, apologies for the delay in responding here! Welcome to Microsoft Q&A Forum, Thank you for posting your query here,

I would look at blob inventory, that will generate a CSV that you can parse to calculate what you are looking for:
Enable Azure Storage blob inventory reports | Microsoft Docs


azure-blob-storage javascript sdk, how can I get the total byte size of blobs inside a folder? "Presently this feature isn't available"

I would post your feature request to http://aka.ms/azurefeedback , All the feedback you share in these forums
will be monitored and reviewed by the Microsoft engineering teams responsible for building Azure.


Note: You can also use Log Analytics in such scenarios, but it comes with high cost for such accounts.
https://docs.microsoft.com/en-us/azure/azure-monitor/logs/log-analytics-tutorial

Please let us know if you have any further queries. I’m happy to assist you further.


Please do not forget to 199396-screenshot-2021-12-10-121802.png and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.