---
title: Alerts in Microsoft Teams
order: 7
description: Send BxLens alerts and reports to a Microsoft Teams channel with a Workflows (Power Automate) webhook that posts an Adaptive Card.
icon: lucide:users
---

# 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

1. In Teams, open the channel, press the three dots next to its name and choose **Workflows**.
2. Pick the template **Post to a channel when a webhook request is received**.
3. Name it (for example `BxLens alerts`), sign in to the connections it asks for, choose the team and the channel, and finish.
4. 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=...`. The `sig` part is the secret, so treat the whole address like a password.

## 2. Add the channel in BxLens

1. Open **Settings, Notifications, Channels** and press **+ Add channel**.
2. 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.
3. 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.com` or `*.powerplatform.com`. If you go through a proxy, add its host to `notifications.channelHosts`, see [Configuration](../configuration.md#notifications).
- 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 Accepted` when 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](../console/notifications.md#channels) for how alerts are routed.
