我在我的应用服务中创建了一个警报,该警报将警报发送到逻辑应用,然后逻辑应用将消息发布到 Microsoft Teams。 https://docs.microsoft.com/en-us/azure/azure-monitor/platform/action-groups-logic-app
一切都按预期工作接受我可以将数据从个人中获取到我的消息中。
我在逻辑应用程序的架构中使用了以下内容
{
"schemaId": "azureMonitorCommonAlertSchema",
"data": {
"essentials": {
"alertId": "/subscriptions/MyAlert",
"alertRule": "Web - Test teams",
"severity": "Sev1",
"signalType": "Metric",
"monitorCondition": "Fired",
"monitoringService": "Platform",
"alertTargetIDs": [
"/subscriptions/MySub"
],
"originAlertId": "bd40051b-35fa-,
"firedDateTime": "2020-06-03T14:53:34.0942607Z",
"description": "",
"essentialsVersion": "1.0",
"alertContextVersion": "1.0"
},
"alertContext": {
"properties": null,
"conditionType": "SingleResourceMultipleMetricCriteria",
"condition": {
"windowSize": "PT5M",
"allOf": [
{
"metricName": "Http2xx",
"metricNamespace": "Microsoft.Web/sites",
"operator": "GreaterThan",
"threshold": "5",
"timeAggregation": "Total",
"dimensions": [
{
"name": "ResourceId",
"value": "MyWebs.com"
}
],
"metricValue": 24,
"webTestName": null
}
],
"windowStartTime": "2020-06-03T14:45:23.095Z",
"windowEndTime": "2020-06-03T14:50:23.095Z"
}
}
}
}
以下是消息正文“内容”的逻辑代码视图中的详细信息:“
你的 Azure Monitor 警报已触发
\nAzure 监视器警报规则 Web - 测试团队在 @{triggerBody()?['body']?['data']?['alertContext']?['condition']?[' 触发windowEndTime']}
\n
\nRule: @{triggerBody()?['body']?['data']?['essentials']?['alertRule']}
\nBody:@{triggerBody()}
\nHeader :@{triggerOutputs()['headers']}
\nheaders:@{triggerBody()?['headers']}
\essentials:@{triggerBody()?['body']?['data']?['要领']}
\ndata:@{triggerBody()?['body']?['data']}
\nbody:@{triggerBody()?['body']}
唯一填充的字段是正文,没有任何特定字段
你的 Azure Monitor 警报被触发 Azure Monitor 警报规则 Web - 测试团队被触发于
RkkKACgAAAAAAAAAEABEgMLahbH0Sqw1EVoRy7Y8AQAQANlpmHhZlSRMkU6bLTb+DSk=","Content-Length":"1254","Content-Type":"application/json; charset=utf-8"} 标题:要领:数据:正文: