gpt4 book ai didi

azure - Set-AzureRmDiagnosticSetting : Exception type: CloudException, 消息:不支持指标类别 'AllMetrics'

转载 作者:行者123 更新时间:2023-12-03 04:19:28 30 4
gpt4 key购买 nike

我遇到以下异常:

Exception type: CloudException, Message: Metric category 'AllMetrics' is not supported.

为任何存储帐户运行Azure PowerShell命令Set-AzureRmDiagnosticSetting,相同的命令适用于其他资源类型,例如Key Vault服务总线负载均衡器

Azure PowerShell 命令:

Set-AzureRmDiagnosticSetting -ResourceId $ResourceId -Enable $true -RetentionInDays 365 -RetentionEnabled $true

异常详细信息:

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

屏幕截图

enter image description here

还尝试使用不同的存储帐户资源 ID 指定参数 -StorageAccountId $StorageAccountIdLogs,但仍然遇到相同的异常。

最佳答案

Metric category 'AllMetrics' is not supported.

根据错误消息,Azure 存储帐户不支持AllMetrics

要启用存储帐户的指标,您可以使用Set-AzureStorageServiceMetricsProperty .

你可以引用我的示例命令,在我这边运行得很好。

C:\PS>$Context = New-AzureStorageContext -StorageAccountName <StorageAccountName > -StorageAccountKey <StorageAccountKey >
C:\PS>Set-AzureStorageServiceMetricsProperty -ServiceType Blob -MetricsType Hour -MetricsLevel Service -Pass Thru -RetentionDays 10 -Version 1.0 -Context $Context

enter image description here更详细的可以引用这个article .

关于azure - Set-AzureRmDiagnosticSetting : Exception type: CloudException, 消息:不支持指标类别 'AllMetrics',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50466749/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com