MS Teams webhooks: deprecated O365 webhook will break on August 15th, 2024 / October 1st, 2024 #13276

Open
opened 2025-11-02 10:37:04 -06:00 by GiteaMirror · 18 comments
Owner

Originally created by @sommerf-lf on GitHub (Jul 11, 2024).

Description

Source Microsoft
I couldn't find any mention of this in any issue or PR.
Can't be repreduced, as it is not deprecated yet, but the warning already exists: see screenshot
However a Workflow can replace this, which needs a change of the payload sent.

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

image

Git Version

No response

Operating System

No response

How are you running Gitea?

not relevant

Database

None

Originally created by @sommerf-lf on GitHub (Jul 11, 2024). ### Description [Source Microsoft](https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/) I couldn't find any mention of this in any issue or PR. Can't be repreduced, as it is not deprecated yet, but the warning already exists: see screenshot However a Workflow can replace this, which needs a change of the payload sent. ### Gitea Version 1.22.0 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots ![image](https://github.com/go-gitea/gitea/assets/159693954/b7e87005-7875-402b-8abd-a6e915dc4489) ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? not relevant ### Database None
GiteaMirror added the topic/webhooksissue/confirmedissue/workaround labels 2025-11-02 10:37:05 -06:00
Author
Owner

@sommerf-lf commented on GitHub (Jul 11, 2024):

Documentation for new workflow post message: https://learn.microsoft.com/en-us/connectors/teams/?tabs=text1#microsoft-teams-webhook

@sommerf-lf commented on GitHub (Jul 11, 2024): Documentation for new workflow post message: https://learn.microsoft.com/en-us/connectors/teams/?tabs=text1#microsoft-teams-webhook
Author
Owner

@silverwind commented on GitHub (Jul 11, 2024):

https://www.theregister.com/2024/07/09/users_rage_as_microsoft_announces/ is also related. Less then 3 months until they drop the functionality seems far too short of a period.

@silverwind commented on GitHub (Jul 11, 2024): https://www.theregister.com/2024/07/09/users_rage_as_microsoft_announces/ is also related. Less then 3 months until they drop the functionality seems far too short of a period.
Author
Owner

@sommerf-lf commented on GitHub (Jul 11, 2024):

to clearify:

  • will break at October 1st, 2024
  • can't create new endpoints at August 15th, 2024
@sommerf-lf commented on GitHub (Jul 11, 2024): to clearify: - will break at October 1st, 2024 - can't create new endpoints at August 15th, 2024
Author
Owner

@sw2io commented on GitHub (Jul 17, 2024):

i got a same error
#31645

@sw2io commented on GitHub (Jul 17, 2024): i got a same error #31645
Author
Owner

@sommerf-lf commented on GitHub (Jul 18, 2024):

Update from microsoft:

Update 07/17/2024: Due to customer feedback received around the footer message, it will be removed from the cards that are posted within Microsoft Teams.

It will still break, just not show the error warning any more

@sommerf-lf commented on GitHub (Jul 18, 2024): Update from [microsoft](https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/): > Update 07/17/2024: Due to customer feedback received around the footer message, it will be removed from the cards that are posted within Microsoft Teams. It will still break, just not show the error warning any more
Author
Owner

@silverwind commented on GitHub (Jul 23, 2024):

Deprecation was extended to December 2025 with a URL change, otherwise December 2024.

https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/

@silverwind commented on GitHub (Jul 23, 2024): Deprecation was extended to December 2025 with a URL change, otherwise December 2024. https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/
Author
Owner

@bbenouarets commented on GitHub (Jul 24, 2024):

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.

@bbenouarets commented on GitHub (Jul 24, 2024): 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](https://github.com/SecNex/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.
Author
Owner

@PehDeh commented on GitHub (Jul 25, 2024):

There is also a neat Powershell Script which could list also other Connectors in Teams:
https://github.com/12Knocksinna/Office365itpros/blob/master/Report-TeamsApps.PS1
https://office365itpros.com/2024/07/10/teams-office-connectors/

Teams Webhook Finder

@PehDeh commented on GitHub (Jul 25, 2024): There is also a neat Powershell Script which could list also other Connectors in Teams: https://github.com/12Knocksinna/Office365itpros/blob/master/Report-TeamsApps.PS1 https://office365itpros.com/2024/07/10/teams-office-connectors/ > [Teams Webhook Finder](https://github.com/SecNex/teams-webhook-finder)
Author
Owner

@bbenouarets commented on GitHub (Jul 25, 2024):

There is also a neat Powershell Script which could list also other Connectors in Teams:

https://github.com/12Knocksinna/Office365itpros/blob/master/Report-TeamsApps.PS1

https://office365itpros.com/2024/07/10/teams-office-connectors/

Teams Webhook Finder

That is correct. However, there are various dependencies. Modules must be installed and PowerShell is also required. With the Teams Webhook Finder, all I have is a small config and an executable file.
In addition, the cmdlets used to list the app definitions are only in preview, which does not guarantee a reliable application.

@bbenouarets commented on GitHub (Jul 25, 2024): > There is also a neat Powershell Script which could list also other Connectors in Teams: > > https://github.com/12Knocksinna/Office365itpros/blob/master/Report-TeamsApps.PS1 > > https://office365itpros.com/2024/07/10/teams-office-connectors/ > > > > > [Teams Webhook Finder](https://github.com/SecNex/teams-webhook-finder) > > That is correct. However, there are various dependencies. Modules must be installed and PowerShell is also required. With the Teams Webhook Finder, all I have is a small config and an executable file. In addition, the cmdlets used to list the app definitions are only in preview, which does not guarantee a reliable application.
Author
Owner

@yp05327 commented on GitHub (Aug 13, 2024):

You can create a new webhook in workflow, and it seems that the API is the same, they just added the permission control.
https://support.microsoft.com/en-us/office/post-a-workflow-when-a-webhook-request-is-received-in-microsoft-teams-8ae491c7-0394-4861-ba59-055e33f75498

@yp05327 commented on GitHub (Aug 13, 2024): You can create a new webhook in `workflow`, and it seems that the API is the same, they just added the permission control. https://support.microsoft.com/en-us/office/post-a-workflow-when-a-webhook-request-is-received-in-microsoft-teams-8ae491c7-0394-4861-ba59-055e33f75498
Author
Owner

@jordanweschler commented on GitHub (Aug 20, 2024):

The API isn't exactly the same, it seems that the new structure expects the payload to be wrapped in an array. See the following error that occurs when Workflows attempts to create a card:

ExpressionEvaluationFailed. 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.

Annoyingly, teams responds with a 202 and then fails to post the event to a channel. To see the error you need to go into Manage Workflow and view the event history.

@jordanweschler commented on GitHub (Aug 20, 2024): The API isn't exactly the same, it seems that the new structure expects the payload to be wrapped in an array. See the following error that occurs when Workflows attempts to create a card: ``` ExpressionEvaluationFailed. 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. ``` Annoyingly, teams responds with a `202` and then fails to post the event to a channel. To see the error you need to go into `Manage Workflow` and view the event history.
Author
Owner

@yp05327 commented on GitHub (Aug 21, 2024):

I didn't find any documents about this new webhook api. Does MS have it?

@yp05327 commented on GitHub (Aug 21, 2024): I didn't find any documents about this new webhook api. Does MS have it?
Author
Owner

@jordanweschler commented on GitHub (Aug 26, 2024):

I found this page: https://learn.microsoft.com/en-us/connectors/teams/?tabs=text1%2Cdotnet#microsoft-teams-webhook

@jordanweschler commented on GitHub (Aug 26, 2024): I found this page: https://learn.microsoft.com/en-us/connectors/teams/?tabs=text1%2Cdotnet#microsoft-teams-webhook
Author
Owner

@yp05327 commented on GitHub (Aug 27, 2024):

It is not compatibility. So it will be a bug in the future.

see: https://github.com/prometheus/alertmanager/issues/3920

@yp05327 commented on GitHub (Aug 27, 2024): It is not compatibility. So it will be a `bug` in the future. see: https://github.com/prometheus/alertmanager/issues/3920
Author
Owner

@thecicco commented on GitHub (Aug 29, 2024):

Hello everyone,
I was able to find a possible workaround for this problem:

All you need to do is:

  1. create the workflow from the template: [When a Teams webhook request is received].
  2. edit the template
  3. delete all the steps under the action [When a Teams webhook request is received].
  4. add the action [Initialize variable] and edit it as in the picture: PS: don't forget the type=object:
    Screenshot 2024-08-29 alle 15 46 10
  5. add the json that extracts the parameters coming from the webhook and converts them to: [AdaptiveCard] so that they can be printed correctly on teams
{
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "type": "AdaptiveCard",
  "msteams": {
    "width": "Full"
  },
  "body": [
    {
      "type": "TextBlock",
      "text": "@{triggerBody()?['title']}",
      "size": "ExtraLarge",
      "weight": "Bolder"
    },
    {
      "type": "FactSet",
      "facts": [
        {
          "title": "Repository:",
          "value": "@{triggerBody()?['sections'][0]['facts'][0]['value']}"
        },
        {
          "title": "@{triggerBody()?['sections'][0]['facts'][1]['name']}",
          "value": "@{triggerBody()?['sections'][0]['facts'][1]['value']}"
        },
        {
          "title": "Author:",
          "value": "@{triggerBody()?['sections'][0]['activitySubtitle']}"
        }
      ]
    }
  ],
  "actions": [
    {
      "type": "Action.OpenUrl",
      "title": "View in Gitea",
      "url": "@{triggerBody()?['potentialAction'][0]['targets'][0]['uri']}"
    }
  ]
}
  1. add the action [Publish card in a chat or channel] and set the message of the previous action as [Adaptive Card]
    Screenshot 2024-08-29 alle 15 46 41
  2. after doing this save and test.

The end result will look like this:
Screenshot 2024-08-29 alle 16 41 13

I hope it will be useful for you,
Riccardo.

@thecicco commented on GitHub (Aug 29, 2024): Hello everyone, I was able to find a possible workaround for this problem: All you need to do is: 1) create the workflow from the template: [`When a Teams webhook request is received`]. 2) edit the template 3) delete all the steps under the action [`When a Teams webhook request is received`]. 4) add the action [`Initialize variable`] and edit it as in the picture: **PS: don't forget the type=object:** <img width="1171" alt="Screenshot 2024-08-29 alle 15 46 10" src="https://github.com/user-attachments/assets/d13ee8d6-fb1d-4840-833f-471114ff0849"> 5) add the json that extracts the parameters coming from the webhook and converts them to: [`AdaptiveCard`] so that they can be printed correctly on teams ```json { "$schema": "http://adaptivecards.io/schemas/adaptive-card.json", "type": "AdaptiveCard", "msteams": { "width": "Full" }, "body": [ { "type": "TextBlock", "text": "@{triggerBody()?['title']}", "size": "ExtraLarge", "weight": "Bolder" }, { "type": "FactSet", "facts": [ { "title": "Repository:", "value": "@{triggerBody()?['sections'][0]['facts'][0]['value']}" }, { "title": "@{triggerBody()?['sections'][0]['facts'][1]['name']}", "value": "@{triggerBody()?['sections'][0]['facts'][1]['value']}" }, { "title": "Author:", "value": "@{triggerBody()?['sections'][0]['activitySubtitle']}" } ] } ], "actions": [ { "type": "Action.OpenUrl", "title": "View in Gitea", "url": "@{triggerBody()?['potentialAction'][0]['targets'][0]['uri']}" } ] } ``` 6) add the action [Publish card in a chat or channel] and set the message of the previous action as [Adaptive Card] ![Screenshot 2024-08-29 alle 15 46 41](https://github.com/user-attachments/assets/358b149f-cb85-431e-8c7c-15a0f6f8a135) 7) after doing this save and test. The end result will look like this: <img width="777" alt="Screenshot 2024-08-29 alle 16 41 13" src="https://github.com/user-attachments/assets/f6f20da6-9633-4ce7-9977-fce5a167f7cd"> I hope it will be useful for you, Riccardo.
Author
Owner

@PehDeh commented on GitHub (Mar 21, 2025):

@thecicco i tried your tip but got this error:
Delivery: Post "https://prod-xx.westeurope.logic.azure.com:443/workflows/xxxxxxxxxxxxxxxxxxxxxxxxxxxx/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=xxxxxxxxxxxxxx": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
Do you have any ideas?

@PehDeh commented on GitHub (Mar 21, 2025): @thecicco i tried your tip but got this error: Delivery: Post "https://prod-xx.westeurope.logic.azure.com:443/workflows/xxxxxxxxxxxxxxxxxxxxxxxxxxxx/triggers/manual/paths/invoke?api-version=2016-06-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=xxxxxxxxxxxxxx": **context deadline exceeded (Client.Timeout exceeded while awaiting headers)** Do you have any ideas?
Author
Owner

@SupremeVoid commented on GitHub (Aug 22, 2025):

Any news on updating the webhook feature with microsoft teams? Or at least, please provide a working workaround solution. The suggested solution above does not work.

@SupremeVoid commented on GitHub (Aug 22, 2025): Any news on updating the webhook feature with microsoft teams? Or at least, please provide a working workaround solution. The suggested solution above does not work.
Author
Owner

@SupremeVoid commented on GitHub (Aug 29, 2025):

I found a working solution. I didnt get it to work with an adaptive card but at least a normal message being posted into a channel.

  1. Add a microsoft teams webhook in your repository
  2. Check all the boxes for events that you want
  3. Create a workflow for your desired Teams channel. Choose the "Post to a channel when a webhook request is received"
  4. Give it a proper name
  5. Choose the team and the channel
  6. Click create
  7. Click on the workflow in the list, then edit on the top right
  8. Select the first element and copy the HTTP-POST-URL and paste it in the webhook you are creating on your repository in gitea.
  9. In the workflow editor, delete all but the first actions/elements
  10. Add the "Post message in a chat or channel"
  11. Select the "Flow-Bot" for who the publisher of the message should be
  12. choose the team and channel again
  13. Now the most important part. In the Message field. you want to add an expression for every field of the JSON that you get from the webhook message. (Check the messages being sent in the webhook history on the bottom). Click into the field, then choose expression in the popup on the right. Type your expression
  14. Example:
{triggerBody()?['title']}

By: {triggerBody()?['sections'][0]?['activityTitle']}
Repository: {triggerBody()?['sections'][0]?['facts'][0]?['value']}
Pull Request: #{triggerBody()?['sections'][0]?['facts'][1]?['value']}
Details: {coalesce(triggerBody()?['sections'][0]?['text'], 'No details provided')}
[View in Gitea]({triggerBody()?['potentialAction'][0]?['targets'][0]?['uri']})
  1. Save the workflow and test it out.

Cheers 🍻

@SupremeVoid commented on GitHub (Aug 29, 2025): I found a working solution. I didnt get it to work with an adaptive card but at least a normal message being posted into a channel. 1. Add a microsoft teams webhook in your repository 2. Check all the boxes for events that you want 3. Create a workflow for your desired Teams channel. Choose the "Post to a channel when a webhook request is received" 4. Give it a proper name 5. Choose the team and the channel 6. Click create 7. Click on the workflow in the list, then edit on the top right 8. Select the first element and copy the HTTP-POST-URL and paste it in the webhook you are creating on your repository in gitea. 9. In the workflow editor, delete all but the first actions/elements 10. Add the "Post message in a chat or channel" 11. Select the "Flow-Bot" for who the publisher of the message should be 12. choose the team and channel again 13. Now the most important part. In the Message field. you want to add an expression for every field of the JSON that you get from the webhook message. (Check the messages being sent in the webhook history on the bottom). Click into the field, then choose expression in the popup on the right. Type your expression 14. Example: ``` {triggerBody()?['title']} By: {triggerBody()?['sections'][0]?['activityTitle']} Repository: {triggerBody()?['sections'][0]?['facts'][0]?['value']} Pull Request: #{triggerBody()?['sections'][0]?['facts'][1]?['value']} Details: {coalesce(triggerBody()?['sections'][0]?['text'], 'No details provided')} [View in Gitea]({triggerBody()?['potentialAction'][0]?['targets'][0]?['uri']}) ``` 15. Save the workflow and test it out. Cheers 🍻
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13276