Alerts in Microsoft Teams
On this page
Alerts in Microsoft Teams
A Teams channel in BxLens posts alerts and reports to a Teams channel as an Adaptive Card. It needs BoxLang+ and a workflow webhook: the old Office 365 connectors are being retired, and Microsoft's replacement is a workflow that starts when it receives a web request.
1. Create the workflow in Teams
- In Teams, open the channel, press the three dots next to its name and choose Workflows.
- Pick the template Post to a channel when a webhook request is received.
- Name it (for example
BxLens alerts), sign in to the connections it asks for, choose the team and the channel, and finish. - Copy the HTTP POST URL the workflow shows. It looks like
https://prod-12.westus.logic.azure.com:443/workflows/.../triggers/manual/paths/invoke?...&sig=.... Thesigpart is the secret, so treat the whole address like a password.
2. Add the channel in BxLens
- Open Settings, Notifications, Channels and press + Add channel.
- Choose Microsoft Teams, give it a name and paste the URL. It is stored encrypted and never shown again. The list shows only its host.
- Choose the alerts, the lowest severity and the reports, press Save, then Send test.
What the message looks like
A card with the heading in the color of the severity (red, amber, green or blue), a subtitle with the server and the time, the sentence that says what is wrong, a table of facts, and an Open in BxLens button when console.publicUrl is set. A card is made of text blocks only. A text block reads a small Markdown, so BxLens puts a backslash before every *, _, backtick, [, ], ~ and # in text from your servers and replaces < and >: a message that holds [click](https://evil.example) or <at>everyone</at> shows as plain text and links nowhere.
Good to know
- The host must be
*.logic.azure.com,*.webhook.office.comor*.powerplatform.com. If you go through a proxy, add its host tonotifications.channelHosts, see Configuration. - The address must be https and public. It is checked when saved and before every send, and redirects are not followed.
- A card is at most 28 KB, and a longer text is cut with three dots.
- A workflow answers
202 Acceptedwhen it took the message. If the flow itself fails later (a connection expired), Teams shows it in the run history of the workflow, not in BxLens.
See Notifications for how alerts are routed.