Mirror an incident Slack-style thread into a Teams channel
When to use: Sentry fires a critical issue; you want the summary plus @-mention of on-call posted in your #incidents Teams channel.
Prerequisites
- Azure AD app registration with Graph scopes ChannelMessage.Send, Channel.ReadBasic.All, User.Read.All — entra.microsoft.com → App registrations → New, grant admin consent
- Team ID and Channel ID of target channel — Right-click channel → Get link to channel; IDs embedded in URL
Flow
-
Compose the alertFrom the Sentry issue [paste], draft a 3-line incident summary: what broke, user impact, suspected release.✓ Copied→ Concise summary
-
Identify who to @-mentionWho's on-call? Resolve their Teams user id from their email [email]. Return the mention object.✓ Copied→ Resolved user + AAD id
-
Post to the channelPost the summary to channel <id>, @-mentioning the on-call engineer. Also post a follow-up reply with a link to the Sentry issue.✓ Copied→ messageId returned; visible in Teams
Outcome: Every incident gets a structured message in Teams with the right people tagged.
Pitfalls
- @-mentions need a
mentionobject with AAD id; plain@nametext doesn't notify — Resolve user AAD id via Graph first, pass in the mentions array of the message payload - Admin consent required; app won't work until consent granted org-wide — Ask an AAD admin to grant admin consent for your app's scopes