This post has been republished via RSS; it originally appeared at: New blog articles in Microsoft Tech Community.
1. Calculate the capacity of all the storage account at the subscription level – via Portal .
To view the utilization and availability of your storage accounts across all of your subscriptions, perform the following steps.
- Sign in to the Azure portal.
- Select Monitor from the left-hand pane in the Azure portal, and
- Under the Insights section, select Storage Accounts (preview).
IV. Select “Capacity”
For more details, please visit here : https://docs.microsoft.com/en-us/azure/azure-monitor/insights/storage-insights-overview#view-from-azure-monitor
2. Calculate the capacity at the single storage account and different service level (Blob/Queue/Table/File) – via Portal.
- In the Azure portal, select Storage accounts.
- From the list, choose a storage account.
- In the Monitoring section, choose Insights (preview).
iv. Select the Capacity
For more details , please visit here : https://docs.microsoft.com/en-us/azure/azure-monitor/insights/storage-insights-overview#view-from-a-storage-account
3. Calculate the size of a Blob storage container – via PowerShell
This script calculates the size of a container in Azure Blob storage by totaling the size of the blobs in the container.
For more details , please visit here : https://docs.microsoft.com/en-us/azure/storage/scripts/storage-blobs-container-calculate-size-powershell
Script that calculates container size for billing purposes, see Calculate the size of a Blob storage container for billing purposes
4. Calculate the size of a Blob storage container - via Azure CLI
This script calculates the size of a container in Azure Blob storage by totaling the size of the blobs in the container.
5. Calculate the size of a Blob storage container – via Storage explorer
- Sign-in to azure storage explorer using any of the approach mentioned here - https://docs.microsoft.com/en-us/azure/vs-azure-tools-storage-manage-with-storage-explorer?tabs=windows#sign-in-to-azure
- Select the storage of your interest.
- Select the container.
- Click “Folder Statistics” button.
6. Calculate Table storage entity count – via Storage explorer
- Sign-in to azure storage explorer using any of the approach mentioned here - https://docs.microsoft.com/en-us/azure/vs-azure-tools-storage-manage-with-storage-explorer?tabs=windows#sign-in-to-azure
- Select the storage of your interest.
- Select the Table.
- Click “Table Statistics”.
7. Calculate Table storage entity count – via PowerShell
$connectionString = "Connection String of your storage account"
$context = New-AzureStorageContext -ConnectionString $connectionString
$azureStorageTable = Get-AzureStorageTable -Context $context
function GetTableCount($table)
{
#Create a table query.
$query = New-Object Microsoft.WindowsAzure.Storage.Table.TableQuery
#Define columns to select.
$list = New-Object System.Collections.Generic.List[string]
$list.Add("PartitionKey")
#Set query details.
$query.SelectColumns = $list
#Execute the query.
$entities = $table.CloudTable.ExecuteQuery($query)
($entities | measure).Count
}
foreach ($table in $azureStorageTable)
{
"Table name :"+ $table.Name
GetTableCount $table
}
"Total number of tables : " + $azureStorageTable.Count
8. Calculate the size of each entity in azure storage table.
The following expressions shows how to estimate the amount of storage consumed per entity:
Total Entity Size:
- 4 bytes + Len (PartitionKey + RowKey) * 2 bytes + For-Each Property(8 bytes + Len(Property Name) * 2 bytes + Sizeof(.Net Property Type))
The following is the breakdown:
- 4 bytes overhead for each entity, which includes the Timestamp, along with some system metadata.
- The number of characters in the PartitionKey and RowKey values, which are stored as Unicode (times 2 bytes).
- Then for each property we have an 8 byte overhead, plus the name of the property * 2 bytes, plus the size of the property type as derived from the list below.
The Sizeof(.Net Property Type) for the different types is:
- String – # of Characters * 2 bytes + 4 bytes for length of string
- DateTime – 8 bytes
- GUID – 16 bytes
- Double – 8 bytes
- Int – 4 bytes
- INT64 – 8 bytes
- Bool – 1 byte
- Binary – sizeof(value) in bytes + 4 bytes for length of binary array
Note:
- We do not have inbuilt feature to calculate the size of individual table, to do that you would need to write your own script to calculate the size of individual entity i.e. Size of storage table = Sum of all the individual entity in given storage table. (Any type of operation against the storage is counted as a transaction, including reads, writes and deletes and hence it would be charged. For more details, please visit here - https://azure.microsoft.com/en-in/pricing/details/storage/tables/ )