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

# Install the app in Teams

> Build the Sariva Teams app package by hand on manifest schema 1.19, put it in your org's app catalog, add it to the alerts channel, and point Sariva at that channel. Already installed? Update it so Sariva answers thread replies without an @mention.

ⓘINFO

**Before this page:** the bot is registered and its three values are in `.env` or `setup-secret.sh` — [Create the Teams bot](https://sariva.mintlify.site/prerequisites/teams/overview.md). On a company tenant you build the package and your **Teams admin** uploads it; on an evaluation tenant you do both.

## Why a hand-built package

The Developer Portal's **Download app package** emits manifest version **1.30**, and uploading that package to Teams fails with *"Manifest parsing error message unavailable"*. Build the package by hand on schema **1.19** — the version walked live.

## Build the app package

**1. Generate the app id**

Run `uuidgen` (PowerShell: `[guid]::NewGuid()`). This GUID is the **app's** id — not the bot id.

**2. Write manifest.json**

Copy the template below and replace every `<placeholder>`.

**3. Add the two icons**

`color.png` — 192×192, full colour. `outline.png` — 32×32, white on a transparent background.

**4. Zip the three files flat**

No folder inside the zip — the three files sit at its root:

```bash theme={null}
zip sariva-teams-app.zip manifest.json color.png outline.png
```

In PowerShell: `Compress-Archive -Path manifest.json,color.png,outline.png -DestinationPath sariva-teams-app.zip`.

```json theme={null}
{
  "$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.19/MicrosoftTeams.schema.json",
  "manifestVersion": "1.19",
  "version": "1.0.0",
  "id": "<new-guid-for-the-app>",
  "name": { "short": "Sariva", "full": "Sariva Kafka Operations" },
  "developer": { "name": "<your company>", "websiteUrl": "https://<your-site>", "privacyUrl": "https://<your-site>", "termsOfUseUrl": "https://<your-site>" },
  "description": { "short": "Kafka operations assistant", "full": "Sariva observes and manages your Kafka infrastructure from Teams." },
  "icons": { "outline": "outline.png", "color": "color.png" },
  "accentColor": "#FFFFFF",
  "bots": [ { "botId": "<TEAMS_APP_ID>", "scopes": ["personal", "team"], "isNotificationOnly": false, "supportsFiles": false } ],
  "permissions": ["identity", "messageTeamMembers"],
  "validDomains": ["<your-host>"],
  "webApplicationInfo": { "id": "<TEAMS_APP_ID>", "resource": "https://<your-host>" },
  "authorization": {
    "permissions": {
      "resourceSpecific": [
        { "name": "ChannelMessage.Read.Group", "type": "Application" },
        { "name": "ChatMessage.Read.Chat", "type": "Application" }
      ]
    }
  }
}
```

| Placeholder | Value |
| - | - |
| `<new-guid-for-the-app>` | The GUID from step 1 — the app id |
| `<TEAMS_APP_ID>` | The bot ID from [Create the Teams bot](https://sariva.mintlify.site/prerequisites/teams/overview.md#register-the-bot-in-the-developer-portal) — in both `botId` and `webApplicationInfo.id` |
| `<your-host>` | The public hostname in front of `/api/teams/messages`, no `https://` |
| `<your company>`, `<your-site>` | Your company name and website |

### Why the app asks to read channel messages

Without `authorization`, Teams sends Sariva only the channel messages that @mention it, so every reply in a thread needs **@Sariva** again. The two resource-specific permissions let Teams send the rest, and Sariva decides what is meant for it:

* a message that @mentions Sariva — answered;
* a personal chat with Sariva — answered;
* a reply **in a thread Sariva is already part of** — answered without the @mention;
* everything else — a new post without @Sariva, a thread Sariva was never asked into, a group chat without @Sariva — ignored, with no reply.

`ChannelMessage.Read.Group` covers team channels. `ChatMessage.Read.Chat` applies only if the bot is ever installed in a group chat (`"groupChat"` in its `scopes`, which this template does not include); there Sariva still answers only an @mention. `webApplicationInfo.resource` does nothing for these permissions, but Teams rejects the manifest without a value. Any string works.

## Upload to the org catalog

**1. Upload the package**

In Teams: **Apps** → **Manage your apps** → **Upload an app** → **Upload an app to your org's app catalog** → pick `sariva-teams-app.zip`. On a company tenant, this is the step your Teams admin does.

**2. Add it to the alerts channel's team**

**Apps** → **Built for your org** → **Sariva** → **Add** → **Add to a team** → pick the alerts channel. A **team owner** does this step: Teams lists the permissions the app asks for (reading the team's channel messages), and the owner accepts them for that team.

## Update an installed app

The package was first published without the message permissions? Then Sariva answers a channel reply only when it carries **@Sariva**. To fix that:

**1. Edit manifest.json**

Add the `webApplicationInfo` and `authorization` blocks from the template above, and raise `"version"` (for example `1.0.0` → `1.1.0`). Keep the same app `id`.

**2. Re-zip**

The same three files, flat, as in [Build the app package](#build-the-app-package).

**3. Upload the new version**

Teams admin center → **Teams apps** → **Manage apps** → **Sariva** → **Upload file** → pick the new zip. The update can take a while to reach the teams.

**4. Re-add it to each team (a team owner)**

Permissions are granted when the app is added to a team, so the teams that already have it need it added again. In the team: **⋯** → **Manage team** → **Apps** → remove **Sariva**. Then **Apps** → **Built for your org** → **Sariva** → **Add** → **Add to a team** → the same channel, and accept the permissions. Repeat for every team that owns an app channel.

⚠WARNING

**Admin notes.**

<ul>
  <li>**Upload custom apps** must be allowed — Teams admin center → **Teams apps** → **Setup policies** and **Org-wide app settings**.</li>
  <li>On a **brand-new tenant**, the Manage apps actions are greyed out for about 30 minutes. Wait; nothing is wrong.</li>
  <li>**Team owners must be allowed to consent** to the message permissions. The default tenant setting (`ManagedByMicrosoft`) allows it. If your tenant turned it off, re-enable it with Microsoft Graph PowerShell: `Set-MgBetaTeamRscConfiguration -State EnabledForAllApps`.</li>
</ul>

## Point Sariva at the alerts channel

Create the channel in the **Posts** layout. The Threads layout is not supported yet; see [Channels and conversations](https://sariva.mintlify.site/prerequisites/channels-and-conversations.md).

1. In Teams, open the channel's **⋯** menu → **Get link to channel**.

2. Take the `19:…@thread.tacv2` part of the link and URL-decode it: `%3A` → `:`, `%40` → `@`. The GUID elsewhere in the link is the **team**, not the channel.

3. Set it in the platform environment — `.env` on the VM path, the chart's `extraEnv` on EKS:

   ```bash theme={null}
   TEAMS_ALERTS_CHANNEL_ID=19:<channel>@thread.tacv2
   # optional — log-scan approvals go here instead of the alerts channel
   TEAMS_APPROVALS_CHANNEL_ID=19:<channel>@thread.tacv2
   ```

4. Recreate the container so it reads the new value (`docker compose restart` does not re-read `.env`):

   ```bash theme={null}
   docker compose up -d --force-recreate
   ```

The runtime reads the alerts channel **only** from `TEAMS_ALERTS_CHANNEL_ID` — not from `customer_config.yaml`. This channel gets cluster-level alerts (cluster unreachable / recovered, CFK pod OOMKilled and CPU) and advisories about an app with no Teams channel.

## Per-app alerts

Each app that should alert in Teams needs `teams_channel_id` on its [registration](https://sariva.mintlify.site/app-teams/register.md#find-your-teams-channel-id) — found the same way as above. The bot must be installed in that channel's team too: repeat **Add to a team** for each team that owns an app channel. A post into a team without the bot fails and is logged as `per_app_alert_engine_teams_post_failed`.

## Verify

**1. Validate the bot identity**

`sariva validate teams` passes — the token grant, plus the shape of `TEAMS_ALERTS_CHANNEL_ID` when it is set.

**2. Say hi**

Send "hi" to **@Sariva** in the channel, or in a personal chat with the bot. It replies — proving the inbound endpoint, the token check and the outbound reply.

**3. Reply without the @mention**

In the thread Sariva just answered, reply "what can you do?" with no **@Sariva**. It answers. A new channel post without **@Sariva** gets no answer — that is correct.

**4. See an alert land**

An alert for a registered app with a `teams_channel_id` lands in that channel.

If a step fails: [Troubleshooting → Microsoft Teams](https://sariva.mintlify.site/troubleshooting.md#microsoft-teams). Channel ids, approvals and what an alert looks like: [Teams: channels and verification](https://sariva.mintlify.site/prerequisites/teams/channels-verify.md).

## Continue the deployment path

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

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