> ## 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.

# Create the Teams bot

> Register the Sariva bot for Microsoft Teams — the path for a company that already runs Teams and the walked evaluation path — the three values Sariva needs, and the network in both directions.

ⓘINFO

**Setup wizard → the chat-surface step (Step 9 on the EKS + Confluent Cloud path, Step 8 on the EKS + CFK path, Step 5 on the VM path).** An install has **one** chat surface: the wizard offers Slack, Microsoft Teams or none — never both. Choosing Teams templates the three bot values into `setup-secret.sh` (Kubernetes paths) or `.env` (the [VM path](https://sariva.mintlify.site/deploy/vm-docker-cc.md)) and asks for the org alerts channel id (blank skips it). Register the bot and capture those values here **first**.

Teams runs at parity with Slack — chat, text approvals, per-app alerts, advisories. Unlike Slack's outbound-only Socket Mode, Microsoft's Bot Framework calls Sariva **inbound**: `https://<your-host>/api/teams/messages` must be reachable over public HTTPS ([Network](#network) below; the [VM page, section 8](https://sariva.mintlify.site/deploy/vm-docker-cc.md#8-teams-only-expose-the-messaging-endpoint-over-https) shows a worked TLS setup).

Which channels to create (in the **Posts** layout) and how Sariva keeps context in a chat versus a channel: [Channels and conversations](https://sariva.mintlify.site/prerequisites/channels-and-conversations.md).

## Pick your path

> [card] [Your company already uses Teams](#path-a-your-company-already-uses-teams)
>
> The usual case. Register the bot in your tenant, then hand the app package to your Teams admin.

> [card] [First-time / evaluation setup](#path-b-first-time-or-evaluation-setup)
>
> No Microsoft 365 tenant with Teams yet. The path walked live on 2026-10-14 — you do every step yourself.

Both paths end with the same three values, the same network requirements and the same app package ([Install the app in Teams](https://sariva.mintlify.site/prerequisites/teams/install-app.md)).

## Path A: your company already uses Teams

Your tenant already has Teams, so there is no tenant or licence step.

### What you need first

* [ ] Someone who can register an app in your tenant — access to the Teams Developer Portal, or an Azure subscription in the tenant for an Azure Bot resource
* [ ] Your **Teams admin**, who publishes custom apps to your org's app catalog
* [ ] The public HTTPS hostname Sariva will be reachable at, routed through your existing edge ([Network](#network))

### Steps

1. **Register the bot** — either route gives the same three values; use whichever your company already uses:
   * [Register the bot in the Developer Portal](#register-the-bot-in-the-developer-portal) — no Azure subscription needed.
   * [An Azure Bot resource](#alternative-an-azure-bot-resource) — in your own Azure subscription.
2. **[Give Sariva the values](#give-sariva-the-values)** and open the [network](#network) both ways.
3. **Build the app package** ([Install the app in Teams → Build the app package](https://sariva.mintlify.site/prerequisites/teams/install-app.md#build-the-app-package)) and send the zip to your Teams admin with a note like this:

```text theme={null}
Please publish the attached custom Teams app (sariva-teams-app.zip) to our
org app catalog.

- What it is: Sariva, our in-house Kafka operations assistant. It is a bot,
  registered single-tenant in our own tenant (bot ID <TEAMS_APP_ID>).
- Where it is used: personal chats, and team channels it is added to.
- Permissions in the manifest: identity, messageTeamMembers.
- It talks only to https://<your-host>/api/teams/messages.
- Custom apps need to be allowed for the people who will use it
  (Teams admin center → Teams apps → setup / permission policies).

Please tell me when it shows under Apps → Built for your org, so I can add
it to the <team> team's <channel> channel.
```

4. When it shows under **Apps → Built for your org**, [add it to the alerts channel's team and set the channel](https://sariva.mintlify.site/prerequisites/teams/install-app.md#upload-to-the-org-catalog).

## Path B: first-time or evaluation setup

The path walked live on 2026-10-14: a business tenant, a bot registered in the Teams Developer Portal, and an app package you upload yourself.

### What you need first

* [ ] A **Microsoft 365 work tenant with Teams** — see the warning below; this is the prerequisite that costs the most calendar time if you don't already have one
* [ ] An admin in that tenant who can upload custom apps — on a new tenant, that is you
* [ ] The public HTTPS hostname your platform will be reachable at (the messaging endpoint)

⚠WARNING

**A personal Microsoft account cannot do this.** Neither can the Entra tenant Azure creates for a personal account, nor the Microsoft 365 Developer Program. Inside a personal-account tenant, the admin center's Marketplace sells Teams only on a 1-year commitment.

What works is a real **Microsoft 365 business tenant**. A company's existing one is fine (that is Path A); for an evaluation, sign up for a Microsoft 365 Business plan that includes Teams.

### Steps

1. Get the business tenant (above).
2. [Register the bot in the Developer Portal](#register-the-bot-in-the-developer-portal).
3. [Give Sariva the values](#give-sariva-the-values) and open the [network](#network) both ways.
4. [Build the app package and upload it yourself](https://sariva.mintlify.site/prerequisites/teams/install-app.md).

## Register the bot in the Developer Portal

No Azure subscription is needed for this route.

**1. Create the bot**

Go to [dev.teams.microsoft.com](https://dev.teams.microsoft.com) → **Tools** → **Bot management** → **New bot**, and name it. The **Bot ID** is in the page URL (`/tools/bots/<id>/`) — this is `TEAMS_APP_ID`.

**2. Set the endpoint address**

**Configure** → **Endpoint address** = `https://<your-host>/api/teams/messages`, exactly.

**3. Add a client secret**

**Client secrets** → **Add a client secret**. The value is shown **once** — copy it now. This is `TEAMS_APP_PASSWORD`.

**4. Set the bot type to single tenant**

Microsoft blocks new multi-tenant bots, and single tenant is right for an internal bot anyway.

**5. Copy the tenant ID**

[entra.microsoft.com](https://entra.microsoft.com) → **Overview** → **Tenant ID** — this is `TEAMS_TENANT_ID`.

**6. Put the three values where your secrets go**

`.env` on the VM path, `setup-secret.sh` on the Kubernetes paths — see [Give Sariva the values](#give-sariva-the-values).

### Alternative: an Azure Bot resource

If you already have an Azure subscription in the tenant, an Azure Bot resource gives the same three values. In the Azure portal: **Create a resource → Azure Bot**, pricing tier **Free (F0)**, type **Single Tenant**, **Create new Microsoft App ID**. Then, on the bot resource:

* **Configuration** → **Microsoft App ID** is `TEAMS_APP_ID`; **App Tenant ID** is `TEAMS_TENANT_ID`.
* **Manage Password** (next to the App ID) → create a **new client secret** — its value is `TEAMS_APP_PASSWORD`. The secret auto-created with the bot cannot be read back.
* **Configuration** → **Messaging endpoint** = `https://<your-host>/api/teams/messages`.
* **Channels** → **Microsoft Teams** → enable it.

## Give Sariva the values

The three values go where your path's secrets go — `.env` on the [VM path](https://sariva.mintlify.site/deploy/vm-docker-cc.md#5-fill-the-env), `setup-secret.sh` on the Kubernetes paths:

```bash theme={null}
TEAMS_APP_ID=<bot-id>
TEAMS_APP_PASSWORD=<client-secret-value>
TEAMS_TENANT_ID=<tenant-id>
```

Set all three: a single-tenant bot gets its token from its own tenant, and `sariva validate teams` requires the tenant ID.

Two optional variables:

| Variable | What it does |
| - | - |
| `TEAMS_ALERTS_CHANNEL_ID` | The org-level channel for cluster-level alerts (cluster unreachable / recovered, CFK pod OOMKilled and CPU) and the fallback for advisories about an app with no Teams channel. The wizard writes it **only if you enter one**; you can also add it after the app is installed ([Point Sariva at the alerts channel](https://sariva.mintlify.site/prerequisites/teams/install-app.md#point-sariva-at-the-alerts-channel)). It is the **only** place the channel is set: the platform and `sariva validate teams` read this variable, not `customer_config.yaml`. |
| `TEAMS_APPROVALS_CHANNEL_ID` | Optional. Where requests that need a platform SRE's decision go — log-scan approvals, budget warnings and cap pauses. Blank or unset, they go to `TEAMS_ALERTS_CHANNEL_ID`. The wizard asks for it right after the alerts channel and writes it **only if you enter one**; environment variable only. |
| `TEAMS_SERVICE_URL` | The Bot Framework endpoint proactive posts start from. Default `https://smba.trafficmanager.net/teams/`. Every inbound message replaces it with the service URL Microsoft sent, **in memory only** — after a restart it starts again from this value. Set it as an environment variable — it is the only place the platform reads it. |

Each app that should alert in Teams also needs `teams_channel_id` on its registration — see [Install the app in Teams → Per-app alerts](https://sariva.mintlify.site/prerequisites/teams/install-app.md#per-app-alerts).

## Network

### Inbound: Microsoft calls Sariva

* Microsoft's Bot Framework must reach `https://<your-host>/api/teams/messages` over **public HTTPS** with a valid certificate — it will not call a plain-HTTP or self-signed endpoint. That URL must be exactly the bot's endpoint address.
* **Companies with an existing edge:** expose **only that path** through your reverse proxy, ingress, API gateway or WAF, forwarded to the platform's port `8000` at the same path. Nothing else on Sariva needs to be public — the REST API stays private. Pass the `Authorization` header and the JSON body through unchanged: the header carries Microsoft's token.
* Sariva checks the token Microsoft signs on **every** call and rejects a call without a valid one (`401`) before the message reaches the agents.
* On the VM path, [section 8](https://sariva.mintlify.site/deploy/vm-docker-cc.md#8-teams-only-expose-the-messaging-endpoint-over-https) uses Caddy with a Let's Encrypt certificate — one example, not a requirement. On EKS the chart has no Ingress, and this is not yet walked.

### Outbound: Sariva calls Microsoft

| Host | Port | Used for |
| - | - | - |
| `login.microsoftonline.com` | 443 | The bot's token (client-credential grant) — every reply and post, and `sariva validate teams` |
| `smba.trafficmanager.net` | 443 | Replies and channel posts (the Bot Framework service URL) |
| `login.botframework.com` | 443 | The signing keys Sariva checks Microsoft's inbound token against |

**Through an egress proxy.** All three calls honour the standard `HTTPS_PROXY` and `NO_PROXY` environment variables — the Bot Framework SDK and its token library make them with Python `requests`, which reads both. Set them in the platform's environment: `.env` on the VM path (the container reads it, and `sariva validate` loads it too), the chart's `extraEnv` on EKS. They are process-wide, not Teams-only, so list in `NO_PROXY` any host that must not go through the proxy. Checked on 0.5.139 by pointing `HTTPS_PROXY` at a dead proxy: all three calls failed at the proxy, and each went direct once its host was in `NO_PROXY`.

## Validate

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

A pass proves the **token grant** — Sariva authenticated against your tenant with the bot ID and secret — and, when `TEAMS_ALERTS_CHANNEL_ID` is set, that it has the shape of a channel id. It posts nothing. With no `notifications.teams` block in `customer_config.yaml`, validate prints `skipped` and exits 0. The end-to-end check — a reply in Teams and an alert in the channel — comes after the app is installed: [Install the app in Teams → Verify](https://sariva.mintlify.site/prerequisites/teams/install-app.md#verify).

## Continue the deployment path

> [card] [Next: install the app in Teams](https://sariva.mintlify.site/prerequisites/teams/install-app.md)
>
> Build the schema-1.19 app package, put it in the org catalog, add it to the alerts channel.

> [card] [Back to the prerequisites checklist](https://sariva.mintlify.site/prerequisites/checklist.md)
>
> Return to the full prerequisites list for your deployment path.


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