An Azure service that stores unstructured data in the cloud as blobs.
Thanks for reaching out in Microsoft Q&A forum,
Is there any way to see sizes of individual prefixes within Storage Account containers?
Yes, you can check sizes of individual prefixes (virtual folders) in Azure Blob Storage containers, but it requires scripting since the portal lacks native prefix-level metrics. Use Azure CLI or PowerShell to list blobs per prefix and sum their sizes—this identifies the largest space consumers efficiently.
Azure CLI Approach
Run az storage blob list with --prefix to target a folder, then aggregate sizes in a script. For example:
az storage blob list --account-name <storage-account> --container-name <container> --prefix "your/prefix/" --query "[].{Name:name, Size:properties.contentLength}" -o table --auth-mode login
Loop over prefixes in Bash/Python for a full report; enable hierarchical namespace on the account for better directory handling.
Metrics show container totals only (via Monitor > Capacity); for visuals, Azure Storage Explorer displays folder sizes on refresh. Inventory reports (Blob service > Data management) enable CSV exports for Synapse analysis at prefix level.
Update:
I need a way to see a summary of the sizes of the prefixes themselves, not of the individual files within them. I would also like to know the size of any nested prefixes.
Azure Blob Storage doesn't provide native prefix-level size metrics in the portal, but you can use this PowerShell script to get a complete breakdown of all prefixes (including nested folders) and their total sizes:
Script:
Azure PowerShell
$account = "venkattest326"
$container = "test"
$rgName = "v-venkatesan"
# Get context with RG specified
$ctx = (Get-AzStorageAccount -ResourceGroupName $rgName -Name $account).Context
# Get all blobs and calculate prefix sizes recursively
$prefixSizes = @{}
Get-AzStorageBlob -Container $container -Context $ctx | ForEach-Object {
$pathParts = $_.Name -split '/'
$currentPrefix = ""
for ($i = 0; $i -lt $pathParts.Count -1; $i++) { # Stop before filename
$currentPrefix += if ($currentPrefix -eq "") { $pathParts[$i] } else { "/$($pathParts[$i])" }
$prefixKey = "$currentPrefix/"
if (-not $prefixSizes.ContainsKey($prefixKey)) {
$prefixSizes[$prefixKey] = 0
}
$prefixSizes[$prefixKey] += $_.Length
}
}
# Convert to objects, sort by size, display
$prefixSizes.GetEnumerator() | ForEach-Object {
[PSCustomObject]@{
Prefix = $_.Key
SizeGB = [math]::Round($_.Value / 1GB, 2)
}
} | Sort-Object SizeGB -Descending | Format-Table -AutoSize
Output:
Azure PowerShell
Prefix SizeGB
------ ------
sample/ 0.250
sample/data/ 0.110
data/ 0.000
Reference:
Kindly let us know if the above helps or you need further assistance on this issue.
Please do not forget to
and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.