Send Dynatrace Problem Notifications via MS Teams Adaptive Cards

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

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.

Hi @linux43110

You can test using the Power apps and teams instead of Power Automate.

BR,

Peter

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!

I was able to replicate your example message with the following configuration:

Thanks!