question

GaneshShrivas-1319 avatar image
0 Votes"
GaneshShrivas-1319 asked SumanthMarigowda-MSFT commented

Calculate Storage account costing

Hi Team,

I want to calculate storage account costing, Specially for "Blog Storage" . When I read documentation and checked Azure price calculator it Uses "Capacity" in DB to calculate price. So I tried blog storage apis which is available here on portal - https://docs.microsoft.com/en-us/rest/api/storagerp/blob-containers/list

I check response of all api's but not getting information regarding the capacity used by blog-storage account. so I want suggestion How can we calculate COST for storage account.

azure-storage-accountsazure-blob-storageazure-table-storageazure-queue-storage
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.

AndreasBaumgarten avatar image
0 Votes"
AndreasBaumgarten answered

Hi @GaneshShrivas-1319 ,

in Azure Portal it's possible to calculate and see the capacity of a blob container:

127427-image.png


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten



image.png (114.6 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.

GaneshShrivas-1319 avatar image
0 Votes"
GaneshShrivas-1319 answered

Hi @AndreasBaumgarten Thanks for you quick reply.

I know I can check capacity information from Portal But I need this information in rest API so that I can show it on my website.

Please let me know if any Rest API in available which will return blob storage information I found some API related to blob but they are not returning Capacity information. here are API LIST related to blog storage

https://docs.microsoft.com/en-us/rest/api/storagerp/blob-containers/list


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.

sadomovalex avatar image
0 Votes"
sadomovalex answered

not sure is it public API or not but MS uses the following request: if you go to Container properties page, run Fiddler and then click Calculate size - you may see HTTP GET request which will looks like that:

GET https://{storageAccountName}.blob.core.windows.net/{containerName}?restype=container&comp=list&sv=2020-08-04&ss=bqtf&srt=sco&sp=rwdlacuptfxi&se=2021-08-30T22:26:45Z&sig=...

It will return xml response which looks like this:

127550-2021-08-30-17-35-04.png

i.e. set of blobs with different BlobType (on above picture there are only BlockBlob). Then I assume it calculates overall size as sum of sizes of each blob (per type) and shows it on Container size:

127635-2021-08-30-17-36-19.png



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.

GaneshShrivas-1319 avatar image
0 Votes"
GaneshShrivas-1319 answered SumanthMarigowda-MSFT commented

thanks @sadomovalex for your response it helps but these api not public so I can't use it.

· 1
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.

@GaneshShrivas-1319 For better understanding the issue: What’s the purpose of calculating storage account costing? Will you please elaborate?


In mean while refer to this article provides the answer you are looking for Azure PowerShell script sample - Calculate the total billing size of a blob container | Microsoft Docs

Additional information: Plan and manage costs for Azure Blob Storage
The Azure Storage blob inventory feature provides an overview of your containers, blobs, snapshots, and blob versions, cost within a storage account. Use the inventory report to understand various attributes of blobs and containers such as your total data size, age, encryption status, immutability policy, and legal hold and so on.
https://docs.microsoft.com/en-us/azure/storage/blobs/blob-inventory

Calculate blob count and total size per container using Azure Storage inventory


1 Vote 1 ·