I am getting below exception:
Exception type: CloudException, Message: Metric category 'AllMetrics' is not supported.
Running Azure PowerShell command Set-AzureRmDiagnosticSetting
for any Storage Account, same command works fine other resource type like Key Vault, Service Bus, Load Balancers etc.
Azure PowerShell command:
Set-AzureRmDiagnosticSetting -ResourceId $ResourceId -Enable $true -RetentionInDays 365 -RetentionEnabled $true
Exception details:
Set-AzureRmDiagnosticSetting : Exception type: CloudException, Message: Metric category 'AllMetrics' is not
supported., Code: BadRequest, Status code:BadRequest, Reason phrase: Bad Request
At line:1 char:1
+ Set-AzureRmDiagnosticSetting -ResourceId '/subscriptions/c1ddf901-1db ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : CloseError: (:) [Set-AzureRmDiagnosticSetting], PSInvalidOperationException
+ FullyQualifiedErrorId : Microsoft.Azure.Commands.Insights.Diagnostics.SetAzureRmDiagnosticSettingCommand
Screenshot
Also tried specifying parameter -StorageAccountId $StorageAccountIdLogs
with different Storage Account resource ID, still getting same exception.