Check actual size of data in Azure storage account or container

Learn how to check the actual size of data in Azure storage account.

John Savill

July 9, 2015

1 Min Read
Image of shipping containers

Q. How can I check the actual size of my Azure Storage account?

A. Regular Azure Storage uses sparse storage which means you only actually pay for the amount of data written and not the size of, for example, the VHDs stored in containers. If I have a 127 GB fixed VHD but it only has 16 GB of data written to it I only pay for 16 GB of actual data cost.

A great script is available at https://gallery.technet.microsoft.com/Get-Billable-Size-of-32175802 and once downloaded I did need to make one small change to make it work. At the start of the Get-BlobBytes function for the second parameter change its cast to:

[Microsoft.WindowsAzure.Commands.Storage.Model.ResourceModel.AzureStorageBlob]$Blob)

Therefore the start of the function is:

function Get-BlobBytes{  param (  [Parameter(Mandatory=$true)]  [Microsoft.WindowsAzure.Commands.Storage.Model.ResourceModel.AzureStorageBlob]$Blob)

Once you have made this change its easy to use the script and it outputs the actual real size of used data and therefore the amount of data you would get billed for.

.CalculateBlobCost.ps1 -storageaccountname "savtechstorenortheurope" 

[Container World  delivers real-world case studies from the cloud-native ecosystem, hands-on technical education, the best speakers and cutting-edge startups under one roof. Get your ticket.]

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like