fluxcd / notification-controller

The GitOps Toolkit event forwarder and notification dispatcher
https://fluxcd.io
Apache License 2.0
150 stars 132 forks source link

Teams Incoming Webhook deprecation #878

Open trenslow opened 1 month ago

trenslow commented 1 month ago

Hi Flux team,

I've been happily using the MS Teams incoming webhook functionality for quite some time now. Annoyingly, they are now deprecating the O365 connectors in favor of Power Automate Workflows.

Unfortunately, the workflow webhook request requires a different schema than the O365 connector, causing the workflow to fail.

Is it possible for Flux to implement this new schema? I guess a new Provider type would have to be created and a migration process devised. According to the first link, the O365 connector will stop working on 1 Oct. 2024, so there's a bit of time to game-plan.

Thanks for your consideration

Zheer09 commented 1 month ago

Definitely we need this to have a new schema power automate can have adaptivecard that can be created from here https://adaptivecards.io/

stefanprodan commented 1 month ago

If the current API we use is going away in October, wouldn't be better to move the msteams provider to the new API?

aspexdaniel commented 1 month ago

If the current API we use is going away in October, wouldn't be better to move the msteams provider to the new API?

There's no new API from msteams side, the solution provided by MS is to create a Workflow in PowerAutomate, which by default only accepts Adaptive Card message format. The workflow will generate an URL as the calling endpoint.

trenslow commented 1 month ago

If the current API we use is going away in October, wouldn't be better to move the msteams provider to the new API?

It seems like if the provider starts sending an AdaptiveCard instead of the old MessageCard, the migration from incoming webhook to power automate workflows will be relatively straightforward. The current incoming webhook connector accepts both MessageCards and AdaptiveCards, so it wouldn't break the current provider/alert config.

Zheer09 commented 1 month ago

If the current API we use is going away in October, wouldn't be better to move the msteams provider to the new API?

It seems like if the provider starts sending an AdaptiveCard instead of the old MessageCard, the migration from incoming webhook to power automate workflows will be relatively straightforward. The current incoming webhook connector accepts both MessageCards and AdaptiveCards, so it wouldn't break the current provider/alert config.

But is it possible to change the payload of the alert that flux will send to that webhook? If it is possible that can work and change the payload to adaptivecard then create a power automate workflow webhook for teams

muandane commented 1 month ago

Well i tried a simple webhook on workflow and it's not working it gets parsing issues Action 'Send_each_adaptive_card' failed: The execution of template action 'Send_each_adaptive_card' failed: the result of the evaluation of 'foreach' expression '@triggerOutputs()?['body']?['attachments']' is of type 'Null'. The result must be a valid array. image

bbenouarets commented 1 month ago

If other system administrators are having difficulties locating the affected teams: I have written a small tool in Golang that uses the Graph API to output the affected teams.

Teams Webhook Finder

This has helped us enormously, as Microsoft does not offer its own solution for reading the affected channels and teams. We have over 350 teams in our company, which we would otherwise have had to search through manually.

giladk1221 commented 1 month ago

Hi, Do you have update about how can I implement Teams webhook using Power Automate with FluxCD?

@yuval987