How to calculate size of all Azure Storage Tables from a Subscription using Powershell.
I tried to search online if there is any direct way of querying table sizes but looks like there isn't. Can you someone please give me a working model of calculating a Azure Storage Table size.
Please.
FOREACH ($SubscriptionID in $Subscriptions) {
Write-Host -ForegroundColor Green "Working on $N. $SubscriptionID"
$StorageAccounts = Get-AzStorageAccount
FOREACH ($StorageAccount in $StorageAccounts) {
$StorageAccountName = $StorageAccount.StorageAccountName
Write-Host -ForegroundColor Yellow "Working on $StorageAccountName"
$AllTables = Get-AzStorageTable -Context $StorageAccount.Context
FOREACH ($TableName in $AllTables) {
$Name = $TableName.Name
Write-Host -ForegroundColor Green "Working on $StorageAccountName,$Name"
Get-AzStorageTable –Name $TableName.Name –Context $StorageAccount.Context
}
}
$N = $N+1
}