Microsoft Teams connector deprecated / switch to Workflows URL in CI
Microsoft retired Office 365 Connectors (the classic "Incoming Webhook" in a channel) in favor of Power Automate Workflows. Old connector URLs stop delivering, and posts either fail or silently drop. The fix is to create a Workflows-based webhook and send an Adaptive Card.
What this error means
A Teams notify step that worked for months returns a 4xx, an error page, or delivers nothing. The webhook URL points at the legacy connectors host rather than a Power Automate flow.
< HTTP/1.1 400 Bad Request
Bad payload received by generic incoming webhook.Common causes
The legacy connector was retired
Classic Office 365 Connector webhooks are being turned off; a URL tied to a retired connector no longer delivers.
The new endpoint expects a different payload
Even after migrating, sending a MessageCard to a Workflows URL fails because Workflows expects an Adaptive Card attachment.
How to fix it
Create a Workflows incoming webhook
- In the target Teams channel, add a Workflow using the "Post to a channel when a webhook request is received" template.
- Copy the generated HTTP POST URL.
- Replace the old
TEAMS_WEBHOOK_URLsecret with the new Workflows URL.
curl -sS -X POST -H 'Content-Type: application/json' \
--data @card.json "$TEAMS_WEBHOOK_URL"Send an Adaptive Card attachment
Workflows endpoints require the message/attachments envelope with an Adaptive Card.
{"type":"message","attachments":[{"contentType":"application/vnd.microsoft.card.adaptive","content":{"type":"AdaptiveCard","version":"1.4","body":[{"type":"TextBlock","text":"CI build passed"}]}}]}How to prevent it
- Migrate any remaining connector webhooks to Power Automate Workflows.
- Store the Workflows URL in a secret and update it in one place.
- Assert a 2xx status so a retired endpoint fails the notify step.