Skip to content

Teams webhook payload has has atypical attachment attribute #403

@mheiges

Description

@mheiges

Describe the bug

Alerts to Teams power automate workflow is not posted to channel due to json attribute mismatch

To Reproduce

my Teams workflows are created as described here

my kwatch configmap has

data:
  config.yaml: |
    alert:
      teams:
        webhook: https://prod-000.westus.logic.azure.com:443/workflows/...

Expected behavior
kwatch alert should be posted to Teams channel

Actual behavior

The Teams notification is posting json like

{
  "title": ...,
  "text": ...,
  "attachment": [
    {
      "content": {
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "body": [ ... ],
        "type": "AdaptiveCard",
        "version": "1.2"
      },
      "contentType": "application/vnd.microsoft.card.adaptive"
    }
  ]
}

and my workflow is rejecting it because 'triggerBody()['attachments']' cannot be evaluated.

Based on the documentation, kwatch's attachment attribute should be attachments (plural).

I can create custom workflows to accomodate kwatch's payload but it would be useful if kwatch had an option to use the commonly used format so I can re-use my existing workflows used by other notifiers. See for example
New Relic, Jenkins, Airflow,Prometheus

Version/Commit
[email protected]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions