MS Teams notifications to the new Teams Workflow?

You may have already heard that Microsoft is deprecating the O365 connectors in teams (which are currently used to send notifications to MS Teams) and replace it by Workflows (see: Retirement of Office 365 connectors within Microsoft Teams).

So, has anyone of you already successfully setup such Workflow? Any information/docu to share?

Thanks,
Christian

4 Likes

Hi there, I just tried, but not successfull yet, will try again tomorrow!

1 Like

We are also trying to switch to the new Teams Workflow but like oggi, we are not yet successfull.

1 Like

Hi,
i am not successful yet.
Is it an option to send an e-mail to the teams channel e-mail address?

1 Like

is there such a possibility to receive an email in a channel and display it as message?

EDIT: quickly checked: there is an app in Teams to monitor an O365 inbox. We are not using O365 as email provider (yet)…so it won’t work in my case

1 Like

OK, got a workaround:

Incoming email working, as I can send it to name.surname@company.onmicrosoft.com
Then the incoming mail seems to work and is posting in the channel!

I’m not an O365 expert, but doesn’t that mean that you would need an additional mailbox which requires an additional license? (sorry for that dumb question :slight_smile: )

2 Likes

I am using my own inbox with a proper filter that moves the email to a folder and the workflow checks only that precise folder.

1 Like

Will checkmk server support MS Team Workflows? I am unable to get it working via existing Webhook facility

image

According to Microsoft @ Retirement of Office 365 connectors within Microsoft Teams

We will gradually roll out this change in waves:

  • Wave 1 – effective August 15th, 2024: All new Connector creation will be blocked within all clouds
  • Wave 2 – effective October 1st, 2024: All connectors within all clouds will stop working

Hello all!

Our team is looking into this question but it will require time for investigation.
We will keep you updated.

3 Likes

Looks like the notification plugin needs to be rewritten to send the information as “AdaptiveCard” instead of “MessageCard”.

I now created a simple workflow in Teams by selecting the template “Post to a channel when a webhook request is received” and then tried to send the following data with curl to this webhook and succeeded!

{
   "type":"message",
   "attachments":[
	  {
		 "contentType":"application/vnd.microsoft.card.adaptive",
		 "contentUrl":null,
		 "content":{
			"$schema":"http://adaptivecards.io/schemas/adaptive-card.json",
			"type":"AdaptiveCard",
			"version":"1.2",
			"body":[
				{
				"type": "TextBlock",
				"text": "For Samples and Templates, see [https://adaptivecards.io/samples](https://adaptivecards.io/samples)"
				}
			]
		 }
	  }
   ]
}
1 Like

Was able to modify the msteams plugin for sending an AdaptiveCard to a Teams channel.

in function _msteams_msg I just replaced the return data (not yet complete, just added something for testing:

    return {
        "type": "message",
        "attachments": [
            {
                "contentType": "application/vnd.microsoft.card.adaptive",
                "contentUrl": "null",
                "content": {
                    "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
                    "type": "AdaptiveCard",
                    "version": "1.2",
                    "body": [
                        {
                            "type": "TextBlock",
                            "text": substitute_context(title, context),
                            "weight": "bolder",
                            "size": "large",
                            "id": "cmkTitle"
                        },
                        {
                            "type": "TextBlock",
                            "text": substitute_context(subtitle, context),
                            "weight": "bolder",
                            "id": "cmkSubtitle"
                        },
                        {
                            "type": "TextBlock",
                            "text": substitute_context(summary, context),
                            "id": "cmkSummary"
                        }
                    ]
                }
            }
        ]
    }

One thing to mention: looks like the HTTP status of the call is here no longer 200 but 202, which causes CheckMk to think that the notification has failed.

EDIT: issue with status already fixed, so nice that function process_by_status_code has this parameter “success_code” :slight_smile:

3 Likes

I’m currently trying to get an overview of what’s needed.
Are you sure this AdaptiveCards are not effected by the retirement?

I would think the right way would be to use this Workflow app as suggested by MS.

It’s Microsoft, so can one be sure about anything? You may be right about AdaptiveCard, if I remember I stumbled about a message that it might be deprecated too (but don’t find that information anymore).

Maybe it will also work when we embed the current MessageCard in the above construct as attachment. Will try this out later today.

i am no O365 expert too. I can’t find the requirements for teams channel mail yet. Just found the following informations about.

How to get email address of teams channel

Limits of email to teams

From my point of view this is a good alternative to the plugin. I am already using it and get good notifications there.

it’s both that we need. first there needs to be the workflow defined (template “Post to a channel when a webhook request is received”) and then we can send the AdaptiveCard to this new “workflow webhook” in the format as described above (AdaptiveCard as part of the “attachments”)

1 Like

Yes, i think that’s the way to go.
Your examples are very useful, big thank you for that.

Will adjust the notification script next week so we should be prepared.
It’s not nice that users have to take action on there side but i think there will be no way around that.

1 Like

a quick write up on steps on WorkFlow side would help here, there is a limitation of workflows not posting to private Channels and such. Will new setup require a valid O365 user (service account) ?

If we have to change the script, we will also adapt the related article in our docs

1 Like

until then, here’s a quick description about creating the workflow (turned out to be easier than expected :slight_smile:)

On a channel click the 3 dots and select “Workflows”:
image

then choose “post to a channel when…”

in the next page you can give the workflow a nice name and then click next and finally on the last page select the team and the channel to which the messages should be posted:

as usual, copy and save the webhook URL

and you’re done :slight_smile:

3 Likes