如何使用 azure CLI 检查 Loganalytic 警报规则是否存在

发布于 2025-01-11 02:50:15 字数 139 浏览 1 评论 0原文

有没有办法使用 Az 命令或 shell 脚本通过警报规则名称检查 Loganalytic 规则是否存在。寻找一些解决方案,我可以检查 Azuredevops 管道运行时参数中给定的警报规则名称是否存在于 Azure 中,如果存在则跳过,如果不存在则创建警报规则。

Is there any way to check the existance of a Loganalytic rule by the alertrulename using Az commands or shell script. Looking for some solution where I can check whether the given alertrule name in Azuredevops pipeline runtime paramenter is existing in Azure , if existing skip and if not existing create the alert rule.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浪漫之都 2025-01-18 02:50:15

您可以使用以下命令查看资源组中的所有日志警报:

az monitor scheduled-query list -g {ResourceGroup}

有关详细信息,请参阅 使用 CLI 管理日志警报

You can view all the log alerts in a resource group using the following command:

az monitor scheduled-query list -g {ResourceGroup}

For more info please refer Manage log alerts using CLI.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文