17 Oct 2024
03:08 PM
- last edited on
23 Jan 2026
10:17 AM
by
IzabelaRokita
Summary: This thread explains how to build MS Teams Adaptive Cards for Dynatrace problem notifications. It includes details on required JSON structures, webhook configuration, and how to display relevant incident information in Teams.
MS Teams have moved to Adaptive Cards when sending content via a webhook, it took me some time to wrap my head around this but here is my simple card. Hopefully, you can extend it as needed. For some reason, it would only work in version 1.4, but that might be unique to our MS Teams.
{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"contentUrl": null,
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "Medium",
"weight": "Bolder",
"text": "{ProblemSeverity} - {ProblemImpact}",
"style": "heading",
"wrap": true
},
{
"type": "TextBlock",
"text": "{ProblemTitle}",
"wrap": true
},
{
"type": "FactSet",
"facts": [
{
"title": "PID:",
"value": "{PID}"
},
{
"title": "Problem Details:",
"value": "{ProblemDetailsText}"
}
]
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "View",
"url": "{ProblemURL}",
"role": "button"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.4"
}
}
]
}
This is what the test message looks like
17 Oct 2024 04:40 PM
Thanks @nick ! Were you using the "Post to a channel when a webhook request is received" workflow template without modifications? I'm getting the following error:
Action 'Post_card_in_a_chat_or_channel' failed: Post as Power Apps can only be used to send Cards for Power Apps into Teams. Please add Cards for Power Apps action in your flow.
I've been actively working on getting Problem notifications working via the new MS Teams / PowerAutomate webhooks for the past few days and getting hung up on the proper formatting of the payload so your post above was quite timely and appreciated.
13 Dec 2024 01:22 PM
Hi Nick,
In your json I notice that you use Dynatrace variables, so I guess that this is your configuration on the Dynatrace side.
How does the configuration for adaptive card look like in your Teams workflow? This is exactly what I am trying to achieve as well.
Thanks in advance!
17 Dec 2024 10:25 AM
I was able to replicate your example message with the following configuration:
Thanks!
Featured Posts