Logic App HTTP Request JSON from Azure Application Insights Alerting Notifications

1.8k Views Asked by At

I have a logic app setup following these directions to push it to a Teams Channel. 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.
  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.

Neither of these options filled out the notification that was pushed to the teams channel. I copied the raw outputs. Put them into 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. "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?

1

There are 1 best solutions below

3
On BEST ANSWER

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)

enter image description here

enter image description here

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). Below screenshot is what I test, I selected all of the parsed fields again, then the logic app was executed as expected.

enter image description here