Hello frigo,
Thanks for your question!
Use az monitor metrics list-definitions
with the Microsoft.Storage/storageAccounts
namespace and --metric-names FileShareCount
to confirm the metric's existence. Post which Uses az monitor metrics list
with the same namespace and --metric "FileShareCount"
to retrieve the current value.
Please be informed that While the File namespace doesn't directly expose a "File Share Count" metric, the Microsoft.Storage/storageAccounts namespace does contain this information. You can retrieve the definition of the FileShareCount
metric using the following command:
az monitor metrics list-definitions --resource /subscriptions/14../resourceGroups/nld11/providers/Microsoft.Storage/storageAccounts/..f4 --namespace Microsoft.Storage/storageAccounts --metric-names FileShareCount -o table
After confirming the definition of the metric, you may obtain the current value by utilizing the az monitor metrics list command.
az monitor metrics list --resource /subscriptions/14../resourceGroups/nld11/providers/Microsoft.Storage/storageAccounts/..f4 --namespace Microsoft.Storage/storageAccounts --metric "FileShareCount" -o table
This command will output the current count of file shares within your specified storage account.
Hope the above answer helps! Please let us know do you have any further queries.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.