运行 Azure CLI 以在 Azure 上的 Application Insight 上创建警报时如何修复此错误?

问题描述 投票:0回答:2

我使用“az monitor scheduled-query”在 Azure 上的 Application Insight 上创建警报,但它显示错误消息“错误:(BadRequest) 范围无法更新” .请帮我修复这个错误

azure azure-application-insights azure-cli
2个回答
0
投票

我已经运行命令以使用以下命令在 Azure VM 的 Application Insights 中创建警报规则:

az monitor scheduled-query create -g "HariTestRG" -n "testkvm01" --scopes "/subscriptions/<subs-id>/resourceGroups/<RGName>/providers/Microsoft.Compute/virtualMachines/testkvm01" --condition "count 'Placeholder_1' > 360 resource id _ResourceId at least 1 violations out of 5 aggregated points" --condition-query Placeholder_1="union Event, Syslog | where TimeGenerated > ago(1h) | where EventLevelName=='Error' or SeverityLevel=='err'" --description "Test rule"

这里的vm_id是虚拟机的资源id。

结果enter image description here

enter image description here

在门户视图中enter image description here

ReferencesMSFT Doc 的 CLI 命令创建 Scheduled Alert


0
投票

我遇到了同样的错误,当我去的时候我对错误有了更好的了解 Azure 门户 > 资源组 >(见下图)

  1. 活动日志
  2. 创建部署
  3. Scheduled query rule write(失败的具体行)
  4. JSON

我的错误原因是另一个 Azure 数据工厂已经存在现有警报规则。所以我重命名了警报规则名称并修复了它。

© www.soinside.com 2019 - 2024. All rights reserved.