Regarding usage price calculation - Azure Blob Storage

Test Admin 131 Reputation points
2024-03-13T07:02:28.16+00:00

We are using Azure Blob Storage with Standard Tier.

We have a query regarding usage price calculation.

If we create multiple containers in the Azure blob storage, is it possible to calculate the usage price for each individual container in the blob storage?

e.g. If we create "Container-A" and "Container-B" in the Azure blob storage, is it possible to calculate monthly usage price for "Container-A" and "Container-B" individually?

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

Accepted answer
  1. Anand Prakash Yadav 5,525 Reputation points Microsoft Vendor
    2024-03-15T10:43:59.8033333+00:00

    Hello Test Admin,

    Thank you for posting your query here!

    You can consider leveraging Blob Inventory. Blob inventory will periodically scan your Storage (can be scoped to container or even folder) and calculate total object size and number of objects, amongst other things. The result of this is delivered to another container in the form of CSV or Parquet file.

    You can also use this PowerShell script that traverses all the blobs in each container and calculates the sizes: Azure PowerShell script sample - Calculate the total billing size of a blob container | Microsoft Learn

    The best option would be analyzing how much data is stored per container (Azure Storage explorer is one option) and use it as alternative to understand usage per container.

    Inventory job fails to complete for hierarchical namespace enabled accounts.
    The inventory job might not complete within 2 days for an account with hundreds of millions of blobs and hierarchical namespace enabled. If this happens, no inventory file is created. If a job does not complete successfully, check subsequent jobs to see if they complete before contacting support. The performance of a job can vary, so if a job doesn't complete, it's possible that subsequent jobs will.

    To count the bytes in a storage account you need to iterate over each object in the storage account. Blob inventory does this for you using some tricks on the backend, but you can also call the list blob api to get your own list (i.e. writing code). Both suffer the same problem on larger accounts it is hard to list all the objects in the account. If you write your own code you can use your knowledge of the account to scale out the listing operation and build robust retry logic because listing a large account will be a significant number of calls to the api.

    Azure Blob Storage pricing: https://azure.microsoft.com/en-in/pricing/details/storage/blobs/

    Understand the full billing model for Azure Blob Storage

    Public preview: Multitasking in the cost analysis preview

    If the issue is still not rectified, for more specialized assistance on this kindly contact Azure Billing support, it's free, and it's the best choice for you: https://azure.microsoft.com/en-in/support/create-ticket/https://azure.microsoft.com/en-in/support/options/

    I hope this helps! Please let me know if you have any other questions or need further clarification.

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


1 additional answer

Sort by: Most helpful
  1. Amrinder Singh 1,740 Reputation points Microsoft Employee
    2024-03-13T09:08:27.2533333+00:00

    Hi @Test Admin - Thanks for reaching out.

    In the billing report which is generated, the calculation is based on the total capacity of account and not just different containers.

    As a workaround, you can attempt to calculate the size of container and then check based on pricing along with pricing calculator, which might help you with some estimates. Below are some of the links that talks about calculating container level capacity and then make use of pricing page to get some estimates further.https://techcommunity.microsoft.com/t5/azure-paas-blog/calculating-container-level-stats-in-azure-blob-storage/ba-p/3064312

    https://techcommunity.microsoft.com/t5/azure-paas-blog/calculate-the-size-capacity-of-storage-account-and-it-services/ba-p/1064046

    https://azure.microsoft.com/en-us/pricing/details/storage/blobs/

    Please let me know for any further queries and will be glad to assist.

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