Reputation: 1
a query can be obtained by reporting the properties (Diagnostic Settings) of the Azure Storage Account services, which are blob properties, file properties, table properties, queue properties.
What I use to get 1 for one is as follows:
$ storageAccountContext = (Get-AzStorageAccount -Name storage1 -ResourceGroupName rg-gruop1) .Context
Get-AzStorageServiceProperty -ServiceType Blob -Context $ storageAccountContext
Get-AzStorageServiceProperty -ServiceType File -Context $ storageAccountContext
Get-AzStorageServiceProperty -ServiceType Table -Context $ storageAccountContext
Get-AzStorageServiceProperty -ServiceType Queue -Context $ storageAccountContext
Upvotes: 0
Views: 142
Reputation: 1398
You just need to get all storage accounts in your subscription, or if you want just accounts in a given resource group, you can use the *-ResourceGroupName * parameter, and then you iterate them using a simple foreach.
$accounts = Get-AzStorageAccount
foreach($account in $accounts){
(...)
}
Upvotes: 1