使用ARM模板创建警报规则 [英] Creating Alert rules with ARM templates

查看:85
本文介绍了使用ARM模板创建警报规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


Azure最近发布了"新一代警报"。可以在Monitor下的Azure门户中获得新的警报体验。

Azure recently released "the new generation of Alerts". The new alert experience is available in the Azure portal under Monitor.


我希望能够使用ARM模板创建警报规则。警报规则的所谓"信号"应该是Log Analytics中的自定义日志搜索,以便我可以使用Log Analytics中的日志数据和指标来触发这些警报。我找到了一个示例
如何使用中的Application Insights创建警报规则
这篇文章
。但我在网上找不到任何关于如何使用Log Analytics作为信号的指导。 

I would like the ability to create alert rules with ARM templates. The so called 'signal' of the alert rule should be a custom log search in Log Analytics, so that I can use the log data and metrics in Log Analytics to fire these alerts. I found an example how to create alert rules using Application Insights in this article. But I cannot find any guidance online how to use Log Analytics as signal. 


目前完全有可能在Azure中创建警报规则门户。但我们需要使用ARM模板创建它们。或者至少应该以编程方式创建它们。

It's currently perfectly possible to create the alert rules in the Azure portal. But we need to create these with an ARM template. Or at at lease should they be create programmatically.


任何建议都将受到高度赞赏。非常感谢您的帮助。 

Any suggestion would be highly appreciated. Many thanks for the help. 


Richard

Richard

推荐答案

您好

可以通过ARM模板创建Log Analytics警报。文档在这里:

Creating Log Analytics alerts is possible via ARM template. The documentation is here:

https://docs.microsoft.com/en-us/azure/operations-management-suite/operations-management-suite-solutions-resources-searches--警告

https://docs.microsoft.com/en-us/azure/operations-management-suite/operations-management-suite-solutions-resources-searches-alerts

与以前唯一的区别是你指定了行动小组。

The only difference from before is that you specify Action Group.

"AzNsNotification": {
        "GroupIds": "[variables('MyAlert').AzNsNotification.GroupIds]",
        "CustomEmailSubject": "[variables('MyAlert').AzNsNotification.CustomEmailSubject]",
        "CustomWebhookPayload": "[variables('MyAlert').AzNsNotification.CustomWebhookPayload]"
        }




将此回复标记为已帮助您解决问题的答案。


Mark this reply as answer it has helped you resolve your issue.


这篇关于使用ARM模板创建警报规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆