Need help with configuring Webhook to MS teams

mallesh.ps

New Member
Nov 4, 2024
4
0
1
Hi,

I'm attempting to configure a webhook to deliver notifications to Microsoft Teams, but it's not working as planned for a variety of reasons. The configuration is described below, and when I do the test, it does not throw any errors, however, in teams, it shows as



1733799781143.png

1733799725759.png

Please help me to resolve this issue.
 

Attachments

  • 1733799718507.png
    1733799718507.png
    7.6 KB · Views: 5
Are you sure that the data and the template are valid? The error sounds a lot like there is something wrong with the JSON.
 
Are you sure that the data and the template are valid? The error sounds a lot like there is something wrong with the JSON.
To be honest, I'm new to this, and there are no examples for MS teams on the Proxmox site either. Could you help me with the configuration?
 
I was able to get it to flow by using the sample json for the adaptive card provided in the video link description.

Code:
{
    "type": "message",
    "attachments": [
      {
        "contentType": "application/vnd.microsoft.card.adaptive",
        "content": {
          "type": "AdaptiveCard",
          "body": [
            {
              "type": "TextBlock",
              "text": "{{ message }}"
            }
          ],
          "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
          "version": "1.0"
        }
      }
    ]
  }
 
Last edited:
I was able to get it to flow by using the sample json for the adaptive card provided in the video link description.

Code:
{
    "type": "message",
    "attachments": [
      {
        "contentType": "application/vnd.microsoft.card.adaptive",
        "content": {
          "type": "AdaptiveCard",
          "body": [
            {
              "type": "TextBlock",
              "text": "{{ message }}"
            }
          ],
          "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
          "version": "1.0"
        }
      }
    ]
  }
This works with the incoming webhook Office 365 connector which will be deprecated shortly but not with the workflow created using Power Automate.
 
Last edited:
Hi, i'm experiencing the same issue when using the Webhook-Workflow from Power-Automate (Created via right-click on channel name -> workflows). Using the now deprecated O365 Connector everything works fine.
From my testing the issue is caused by proxmox (or the http handler) not setting the "Content-Length" header correctly.

Example:

1736169116472.png

Does not work with the same error in power automate as OP posted.
1736168814601.png


But if I include "Content-Length" as a header with the correct amount of bytes in the body
1736168967945.png
the message gets send to the Teams-channel as intended.
1736169063015.png


Another possible source of this issue could be that the Content-Length is apparently included in the request-body as hex representation ("280"(16) in this case):
1736169377919.png
If I include a Content-Length header as shown in the second attempt (above) these "280" at the top and "0" at the bottom of the body do not show up

I hope this helps tracking the issue.
 

Attachments

  • 1736168705844.png
    1736168705844.png
    49.3 KB · Views: 11
This is working for me right now:

1739549759914.png

JSON:
{
  "@type": "MessageCard",
  "@context": "http://schema.org/extensions",
  "themeColor": "e57000",
  "summary": "{{ title }}",
  "sections": [
    {
      "activityTitle": "{{ title }}",
      "activitySubtitle": "Proxmox Notification from ",
      "activityImage": "https://img.icons8.com/?size=512&id=53iFar0HpEW9&format=png",
      "facts": [
        {
          "name": "Host",
          "value": "{{ fields.hostname }}"
        },
        {
          "name": "Message",
          "value": "{{ message }}"
        },
        {
          "name": "Severity",
          "value": "{{ severity }}"
        }
      ],
      "markdown": true
    }
  ]
}


1739549895749.png


Pls be aware that the png used is not my property nor GPL / GNU and needs to be replaced !

Cheers
 
Last edited:
Hi @cbka,
You are currently using the old O365 Connector feature, which works fine, as already mentioned. Issue is that this feature is deprecated and will be shutdown in Dec 2025.
Hi, i'm experiencing the same issue when using the Webhook-Workflow from Power-Automate (Created via right-click on channel name -> workflows). Using the now deprecated O365 Connector everything works fine.
It was previously announced that Connectors would shut down mid-2024 which was postponed after feedback.
All the dates are not properly communicated, but I could find this dev-community thread discussing this: https://devblogs.microsoft.com/micr...office-365-connectors-within-microsoft-teams/

We are still waiting for a response from the team, regarding this issue.

Greetings
 
  • Like
Reactions: cbka
Hi @cbka,
You are currently using the old O365 Connector feature, which works fine, as already mentioned. Issue is that this feature is deprecated and will be shutdown in Dec 2025.

It was previously announced that Connectors would shut down mid-2024 which was postponed after feedback.
All the dates are not properly communicated, but I could find this dev-community thread discussing this: https://devblogs.microsoft.com/micr...office-365-connectors-within-microsoft-teams/

We are still waiting for a response from the team, regarding this issue.

Greetings
Thats unfortunately true .. but hey .. as long as m$ is not communicating the correct date .. why bother?

Do you already have the alternative "new" version for this ? would be happy to learn ...

as far as i understood your last post the issue is that the content length would need to get calculated after the creation of the whole message content, right ?

Cheers,
Chris
 
Thats unfortunately true .. but hey .. as long as m$ is not communicating the correct date .. why bother?

Do you already have the alternative "new" version for this ? would be happy to learn ...

as far as i understood your last post the issue is that the content length would need to get calculated after the creation of the whole message content, right ?

Cheers,
Chris
Hi Chris,
That's exactly what's this threads about. The old (deprecated) method (*.webhhok.office.com) works fine in Proxmox. (It is accepting the way how the Content-Lenght is encoded by Proxmox). The new method (*.logic.azure.com) seems to not accept the missing explicit Content-Lenght header.

Greetings
Erik