简体   繁体   English

逻辑应用 HTTP 从 Azure Application Insights 警报通知请求 JSON

[英]Logic App HTTP Request JSON from Azure Application Insights Alerting Notifications

I have a logic app setup following these directions to push it to a Teams Channel.我按照这些说明设置了一个逻辑应用程序,以将其推送到 Teams 频道。 When the alert is notified it sends a message to my Teams channel successfully.当通知警报时,它会成功向我的团队频道发送一条消息。 However the objects are not parsing out like the example.但是,对象并没有像示例那样解析出来。 I tried 2 things.我尝试了两件事。

  1. Copying step 4 (of the above documentation) into the sample payload to generate the schema.将(上述文档的)步骤 4 复制到示例有效负载中以生成架构。
  2. After the Alert is triggered going into the Logic App run history and grabbing the raw outputs, copying those into the sample payload to generate the schema.触发警报后,进入逻辑应用运行历史记录并获取原始输出,将其复制到示例有效负载中以生成架构。
  3. Used Common Alert Schema definitions for the payload and things still come in blank in Teams.有效负载的使用的通用警报架构定义在 Teams 中仍然是空白的。

Neither of these options filled out the notification that was pushed to the teams channel.这些选项都没有填写推送到团队频道的通知。 I copied the raw outputs.我复制了原始输出。 Put them into PostMan.将它们放入 PostMan。 Sent the request to the endpoint.将请求发送到端点。 This worked when parsing the data into the message posted into the teams channel.这在将数据解析为发布到团队频道的消息时起作用。

It's a simple logic app that is using the designer options: "When an HTTP request is received" for the payload.这是一个使用设计器选项的简单逻辑应用程序:“当收到 HTTP 请求时”作为有效负载。 "Post a message with the flow bot to a channel" to post messages to a team channel. “使用流机器人将消息发布到频道”以将消息发布到团队频道。

What JSON payload or options should I be using for the ability to use a Logic App to push to a Teams Channel successfully?我应该使用哪些 JSON 有效负载或选项才能使用逻辑应用成功推送到团队频道?

I test it in my side, it works fine and I can reproduce your problem.我在我身边测试它,它工作正常,我可以重现你的问题。

First I configure the alert to trigger the logic app, then go to "Runs history" of the logic app and find the outputs of the trigger(you mentioned you copied the raw into sample payload to generate the schema), copy the outputs body of raw but not all of the json content of raw (shown as below two screenshot)首先,我将警报配置为触发逻辑应用程序,然后将 go 配置为逻辑应用程序的“运行历史记录”并找到触发器的输出(您提到您将原始数据复制到示例有效负载中以生成架构),复制输出正文raw,但不是所有的 json 内容(如下图所示)

在此处输入图像描述

在此处输入图像描述

After generate the schema, please select all of the parsed fields again because the expressions of the parsed fields which you selected before may not match the properties now (although it may not show error when you save the logic app if you don't select them again).生成架构后,请再次 select 所有已解析字段,因为您之前选择的已解析字段的表达式现在可能与属性不匹配(尽管如果您不 select 它们保存逻辑应用程序时可能不会显示错误再次)。 Below screenshot is what I test, I selected all of the parsed fields again, then the logic app was executed as expected.下面的截图是我测试的,我再次选择了所有解析的字段,然后逻辑应用程序按预期执行。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM