> ## Documentation Index
> Fetch the complete documentation index at: https://sariva.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Teams: channels and verification

> The channel ids Sariva needs, per-app Teams alerts, what validate proves, what a Teams alert looks like, and approvals in Teams — from the code.

> [!NOTE]
>
> The bot registration, the app install and chatting with the bot were walked live on 2026-10-14 — [Create the Teams bot](https://sariva.mintlify.site/prerequisites/teams/overview.md) and [Install the app in Teams](https://sariva.mintlify.site/prerequisites/teams/install-app.md). The rest of this page states what the code does.

## Channel ids

Sariva addresses a Teams channel by its **channel id**: the `19:...@thread.tacv2` string from the channel's **Get link to channel**. The GUID in that same link is the **team**, not the channel.

Three places take a channel id:

| Where | Setting | Used for |
| - | - | - |
| The whole install | `TEAMS_ALERTS_CHANNEL_ID` — the wizard asks for it when you choose Teams; blank skips it. Set it as an environment variable (`.env` on a VM, the chart's `extraEnv` on EKS) — the only place the platform and `sariva validate teams` read it | Cluster-level alerts (cluster unreachable / recovered, CFK pod OOMKilled and CPU), and advisories about an app that has no Teams channel |
| The whole install (optional) | `TEAMS_APPROVALS_CHANNEL_ID` — the wizard asks for it after the alerts channel; blank skips it. Environment variable only, like the alerts channel | Requests that need a platform SRE's decision — log-scan approvals (on-demand scans and scheduled monitoring), log-scan budget warnings and cap pauses. Unset, they go to `TEAMS_ALERTS_CHANNEL_ID` |
| One app | `teams_channel_id` on the [app registration](https://sariva.mintlify.site/app-teams/register.md#the-fields) | That app's alerts, re-fires and recoveries, and log-scanning notices about it (monitoring approved, turned off) |

The wizard takes either the bare id or the whole link from **Get link to channel** (`teams.microsoft.com` or `teams.cloud.microsoft`) for both install-wide ids: it URL-decodes the link, keeps the `19:…@thread.tacv2` part and shows it back as "Using channel id 19:…". It refuses the team GUID on its own and a link to a chat or to the team. `sariva validate teams` (on `TEAMS_ALERTS_CHANNEL_ID`) and app registration check the shape of a channel id (`19:` … `@thread.` …) and reject anything else — the team GUID and the still-URL-encoded form (`%3A`, `%40`) included. Shape is all they can check: an id for a team the bot is not installed in shows up only when Sariva first posts, as `per_app_alert_engine_teams_post_failed` in the platform log. How an app team finds its id: [Find your Teams channel id](https://sariva.mintlify.site/app-teams/register.md#find-your-teams-channel-id).

## Per-app Teams alerts

Give the app a `teams_channel_id` at registration, or add it later:

```bash theme={null}
curl -X PUT https://<platform-url>/api/v1/apps/payments-consumer \
  -H "Authorization: Bearer <your-token>" \
  -H "Content-Type: application/json" \
  -d '{ "teams_channel_id": "19:<channel>@thread.tacv2" }'
```

On a Teams install, registration requires `teams_channel_id` (or `"chat_alerts": false`) — see [Register an application](https://sariva.mintlify.site/app-teams/register.md#the-fields).

Each alert is a **new root message** in the channel. Sariva does not need an earlier message from anyone to post — it opens the conversation itself — but the bot must be installed in that team ([Install the app in Teams → Per-app alerts](https://sariva.mintlify.site/prerequisites/teams/install-app.md#per-app-alerts)). Posts start from `TEAMS_SERVICE_URL` until an inbound message tells Sariva the tenant's own endpoint ([Give Sariva the values](https://sariva.mintlify.site/prerequisites/teams/overview.md#give-sariva-the-values)).

## What `sariva validate teams` proves

```bash theme={null}
sariva validate teams
```

1. Reads `app_id`, `app_password` and `tenant_id` from `notifications.teams` in `customer_config.yaml`, or from `TEAMS_APP_ID` / `TEAMS_APP_PASSWORD` / `TEAMS_TENANT_ID`. App ID and password are required, then the tenant ID.
2. If an org alerts channel id is set, checks its shape.
3. Requests a token from Microsoft (`login.microsoftonline.com:443`) with the App ID and secret.

A pass proves the **token grant only** — it does not post anywhere. With no `notifications.teams` block, validate prints `skipped` and exits 0. Failures: [Troubleshooting → Microsoft Teams](https://sariva.mintlify.site/troubleshooting.md#microsoft-teams).

## What a Teams alert looks like

The same content as the Slack alert, as Teams markdown: a severity marker and the bold title, then a plain-language **Likely issue** line when Sariva can map one, then the team / cluster / consumer-group line. For example, a critical lag alert:

```text theme={null}
🚨 **Lag exceeded threshold on payments-consumer: lag 62,400 > threshold 10,000 as of 14:05 UTC (group=payments-consumer-grp, cluster=prod-cc-1)**

Likely issue: consumer lag growing
Team: `payments-eng` · Cluster: `prod-cc-1` · Group: `payments-consumer-grp`
```

Markers: 🚨 critical, ✅ a recovery, and 🔴 for every other severity — including warning.

## Approvals in Teams

Approvals are **text** — no cards or buttons. When an action needs approval, the bot's reply ends with:

> **Approval required** — reply in this conversation to approve or decline (your next message is the decision).

A destructive action's data-impact warning is shown above that line. A pull request is posted as a 📥 review link.

Sariva identifies a Teams user by their Microsoft Entra object id. It does not read an email address from Teams, and every Teams user gets the `platform_engineer` role.

## Continue the deployment path

> [card] [Back to the AWS EKS path](https://sariva.mintlify.site/deploy/aws-eks-cc.md)
>
> Return to the EKS path map to confirm where this step fits.

> [card] [Back to the VM path](https://sariva.mintlify.site/deploy/vm-docker-cc.md)
>
> Running on a Linux VM? Return to the VM checklist.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.