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

# Microsoft Teams

> Ask your Guru directly in Microsoft Teams 1-1 chats and channels

## Introduction

Integrate Gurubase with Microsoft Teams to chat with your Guru in personal chats, group chats, and team channels. Unlike Slack and Discord (which use a single OAuth flow), Teams requires you to register your own bot in the Microsoft developer portal and paste its credentials into Gurubase. This guide walks through the full process step by step.

<Note>
  Each Gurubase guru needs its **own** Microsoft Teams bot. You cannot reuse one bot across multiple gurus — the bot id is how Gurubase routes incoming messages back to the correct guru. If you want a bot per product / per team, repeat this guide once per guru, each time creating a fresh bot in `dev.teams.microsoft.com`.
</Note>

***

## Setup

<Steps>
  <Step title="Open the Microsoft Teams Developer Portal">
    Go to [dev.teams.microsoft.com](https://dev.teams.microsoft.com/apps) and sign in with the Microsoft account that owns the Teams tenant you'll deploy the bot to. You'll land on the **Apps** screen.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/1-apps-empty.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=5de40f39ee883f1729bb227173eb1283" alt="Teams Developer Portal — Apps screen" width="3476" height="1718" data-path="images/bots/teams/1-apps-empty.png" />
    </Frame>

    Click **+ New app**, give it a name (e.g. `Gurubase`), and create it.
  </Step>

  <Step title="Add a Bot capability">
    In the left sidebar of your new app, open **App features**.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/2-app-features-empty.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=e79c68fd9aa4676fdedd0d0ccaa866f9" alt="App features picker" width="3472" height="2002" data-path="images/bots/teams/2-app-features-empty.png" />
    </Frame>

    Click the **Bot** card.
  </Step>

  <Step title="Create a new bot">
    On the Bot configuration screen, click **Create a new bot**. Leave the capability checkboxes and scopes alone for now — you'll configure them in Step 6 after the bot exists.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/3-app-features-bot-empty.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=6791948e2e490ca3541cef3402efb7d8" alt="Bot capability form" width="3476" height="2006" data-path="images/bots/teams/3-app-features-bot-empty.png" />
    </Frame>

    You'll land on the **Bot management** page (a list of your bots). Click **+ New bot** in the top toolbar, give it a name, and confirm.

    You'll be redirected to a URL like `https://dev.teams.microsoft.com/tools/bots/<BOT_ID>/configure`. The GUID in the URL is your **Bot ID** — copy it somewhere safe.
  </Step>

  <Step title="Set the messaging endpoint">
    On the bot configuration page you've been redirected to:

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/4-endpoint-empty.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=e7f68c230a8ffca5ecb1d7df6bce6043" alt="Bot configure page" width="3480" height="1778" data-path="images/bots/teams/4-endpoint-empty.png" />
    </Frame>

    In a separate tab, open the Gurubase integration page (Step 13 below) and copy the **Messaging Endpoint** shown there. Paste it into the **Endpoint address** field and click **Save**.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/6-endpoint-full.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=a024ee5ccf7b388e8420cec508d8070d" alt="Endpoint set" width="3466" height="1990" data-path="images/bots/teams/6-endpoint-full.png" />
    </Frame>

    <Note>
      **Self-hosted users:** Teams delivers every message to Gurubase as a webhook, so the messaging endpoint must be reachable from Microsoft's servers on the public internet. A `localhost` or private LAN address (`192.168.x.x`, `10.x.x.x`, etc.) will not work. You only need to expose your Gurubase **frontend** publicly — requests are routed internally from there to the backend. If your frontend isn't already public, front it with a tunnel like [ngrok](https://ngrok.com) or [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/) and replace the host prefix before `/api/...` in the Gurubase-provided messaging endpoint with your tunnel URL.
    </Note>
  </Step>

  <Step title="Generate a client secret">
    In the same bot configuration sidebar, open **Client secrets** → **Create your first client secret**.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/7-secrets-empty.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=86752bacc43f2b613e280cab6b2296d7" alt="Client secrets screen" width="3472" height="1840" data-path="images/bots/teams/7-secrets-empty.png" />
    </Frame>

    The portal will show the secret **Value** once, right after creation. **Copy the Value immediately** — not the Secret ID. If you miss it, generate another and copy the new one.
  </Step>

  <Step title="Link the bot back to your app">
    Go back to **App features** → **Bot** in your app and refresh the page. The **Select an existing bot** dropdown will now list the bot you just created — pick it.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/8-app-selected.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=8259271b17570c468e511882de3c885a" alt="Bot selected in app features" width="3468" height="1988" data-path="images/bots/teams/8-app-selected.png" />
    </Frame>

    Now configure the bot's capabilities on this screen:

    1. Under **What can your bot do?**, check **Upload and download files** (required for PDF / log / img attachments in 1-1 DMs).
    2. Under **Select the scopes where people can use your bot**, check **Personal** and **Team**.

    Click **Save**.
  </Step>

  <Step title="Fill in Basic information">
    Open **Basic information** in the left sidebar. Fill in the required fields (descriptions, version, developer info, privacy URL, terms URL). All fields marked with `*` must be set before the app can be published.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/9-filled-basic-info.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=164612955ba8f11341366f2ea735cdb7" alt="Filled basic information" width="3476" height="1998" data-path="images/bots/teams/9-filled-basic-info.png" />
    </Frame>

    You can use:

    | Field              | Value                                |
    | ------------------ | ------------------------------------ |
    | **Privacy policy** | `https://gurubase.io/privacy-policy` |
    | **Terms of use**   | `https://gurubase.io/terms-of-use`   |
    | **Website**        | `https://gurubase.io`                |
  </Step>

  <Step title="Downgrade manifest version to 1.19">
    Open **App package editor** in the left sidebar and click **manifest.json**.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/10-app-package-editor.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=bd5822760ef2f383b2113c355641a6e5" alt="App package editor" width="3480" height="1708" data-path="images/bots/teams/10-app-package-editor.png" />
    </Frame>

    Find the top-level field:

    ```json theme={null}
    "manifestVersion": "1.25"
    ```

    Change it to:

    ```json theme={null}
    "manifestVersion": "1.19"
    ```

    Save the file.

    <Note>
      Manifest schema 1.25+ requires a `supportsChannelFeatures` declaration for the `team` scope, which the dev portal UI doesn't expose yet. Downgrading to 1.19 sidesteps this check without changing any functionality you care about.
    </Note>
  </Step>

  <Step title="Publish to your organization">
    Open **Publish → Publish to your org** in the left sidebar and click **Get started** (or **Publish your app**).

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/11-publish-empty.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=e980e23b89373c487f9b286d1d75997f" alt="Publish to org" width="3460" height="1990" data-path="images/bots/teams/11-publish-empty.png" />
    </Frame>

    This sends the app to your Teams admin for approval.
  </Step>

  <Step title="Approve the app as a Teams admin">
    Go to the [Teams admin center → Manage apps](https://admin.teams.microsoft.com/policies/manage-apps), search for your app, and click it.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/12-manage-apps.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=e5ab11749eb20cd99a5c99e8bbd63dfa" alt="Manage apps" width="2684" height="1566" data-path="images/bots/teams/12-manage-apps.png" />
    </Frame>

    Click **Publish** to approve the pending version.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/13-publish.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=c704f6b12b941d8f84da14ad7931878c" alt="Publish approval" width="2692" height="1566" data-path="images/bots/teams/13-publish.png" />
    </Frame>

    <Note>
      The approval can take a few minutes to propagate. If you don't see your app in the admin center immediately, refresh after a minute.
    </Note>
  </Step>

  <Step title="Pin the app for users">
    Pinning the app for your org installs it for everyone automatically — without this step users won't see the bot in their Teams sidebar. Go to [Setup policies](https://admin.teams.microsoft.com/policies/app-setup) → click **Global (Org-wide default)**.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/14-policies.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=7b1b29a308d24e21090694a2ea78af5b" alt="App setup policies" width="2692" height="1570" data-path="images/bots/teams/14-policies.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/15-edit-policy.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=267c689f94f42fb0653a08cb298f4c75" alt="Edit global policy" width="2686" height="1540" data-path="images/bots/teams/15-edit-policy.png" />
    </Frame>

    Under **Pinned apps**, click **+ Add apps**, search for your bot, and add it.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/16-policy-add.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=c29de07df5ed3498f506ea879b54f694" alt="Add pinned app" width="2680" height="1562" data-path="images/bots/teams/16-policy-add.png" />
    </Frame>

    Click **Add** then **Save**.
  </Step>

  <Step title="Find your Tenant ID">
    Open the [Microsoft Entra admin center](https://entra.microsoft.com) → **Overview** and copy the **Tenant ID** (a GUID).
  </Step>

  <Step title="Connect in Gurubase">
    Go to **Gurubase Dashboard** → select your Guru → **Integrations** → **Deployments** → **Microsoft Teams**.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/5-gurubase-empty.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=26a323e62f3cdc993c664038ba62fd7b" alt="Gurubase Teams integration page" width="3468" height="1872" data-path="images/bots/teams/5-gurubase-empty.png" />
    </Frame>

    Paste the values you collected:

    | Field             | Source                                     |
    | ----------------- | ------------------------------------------ |
    | **Bot ID**        | The GUID from Step 3 (the bot you created) |
    | **Client Secret** | The secret **Value** from Step 5           |
    | **Tenant ID**     | Your AAD Tenant GUID from Step 12          |

    Click **Connect**. Gurubase will validate the credentials by acquiring a Bot Framework token; if everything is correct you'll see masked values on the page.
  </Step>

  <Step title="Add the bot to each team (for channel use)">
    Org-wide pinning (Step 11) installs the bot into every user's personal sidebar so 1-1 chats work out of the box. But for the bot to reply in a **team channel**, the bot also needs to be installed in that specific team — pinning alone doesn't do this. Repeat the steps below once per team where you want channel support:

    1. In Teams, hover over a team in the sidebar, click the **...** menu next to its name, and select **Manage team**.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/manage-team.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=a02d947f6d28558ea1727bc0c02d8a84" alt="Open Manage team from the team menu" width="492" height="846" data-path="images/bots/teams/manage-team.png" />
    </Frame>

    2. Open the **Apps** tab in the team settings.

    3. Click **Get more apps** in the top-right.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/apps.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=8d87a3be31bdc4985af4717e084292b3" alt="Apps tab inside a team" width="2954" height="1616" data-path="images/bots/teams/apps.png" />
    </Frame>

    4. In the apps store sidebar, click **Built for your org**. Your Gurubase bot will appear in the panel on the right.

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/built-for-your-org.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=601980ce51e56b1654fd179eb80d6c83" alt="Built for your org — Gurubase app" width="1474" height="1624" data-path="images/bots/teams/built-for-your-org.png" />
    </Frame>

    5. Click the bot, then **Add** to install it into the team.

    Once installed, the bot can be `@mentioned` in any channel of that team without further per-channel configuration.
  </Step>

  <Step title="Try it">
    In Microsoft Teams, find your bot under **Apps** (sidebar, bottom-left) or simply start a new chat with the bot's name.

    * **DM**: just type a question — no mention needed.
    * **Channel**: mention the bot — Teams only forwards channel messages to bots when explicitly mentioned. To mention, type `@` and pick the bot from the autocomplete dropdown. Pasting `@bot-name` as plain text does **not** count as a mention; it'll look right in the editor but the bot won't receive the message.

    The bot replies with a streaming **Thinking…** placeholder that updates as the answer arrives, then settles into the final formatted reply with trust score and sources.

    Example of a 1-1 chat exchange:

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/one-on-one-answer-1.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=130c486ba2fa59480bffe5fdfe58c8c6" alt="Bot answering a question in 1-1 chat" width="1986" height="1576" data-path="images/bots/teams/one-on-one-answer-1.png" />
    </Frame>

    <Frame>
      <img src="https://mintcdn.com/gurubase/VMbMwU55JdZg_aT5/images/bots/teams/one-on-one-answer-2.png?fit=max&auto=format&n=VMbMwU55JdZg_aT5&q=85&s=d0558c55be3b950d11da4844d4ab1095" alt="Trust score and sources at the end of the answer" width="1876" height="1058" data-path="images/bots/teams/one-on-one-answer-2.png" />
    </Frame>
  </Step>
</Steps>

***

## Conversation commands

| Command  | What it does                                                                                                                        |
| -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `/clear` | Drops the current conversation context. Your next message starts a fresh conversation. Works in both 1-1 chats and channel threads. |
| `/reset` | Alias for `/clear`.                                                                                                                 |

In 1-1 chats, the conversation context automatically rotates after **30 minutes** of inactivity, so you usually don't need `/clear` unless you want to start fresh sooner.

In channels, each thread is its own conversation — there's no time-based rotation, and `/clear` only resets the thread it was used in.

***

## Attachments

Gurubase processes the following attachment types out of the box:

| Type                              | 1-1 chat | Channel |
| --------------------------------- | -------- | ------- |
| **Images** (PNG, JPEG, GIF, WEBP) | ✓        | ✗       |
| **PDF**                           | ✓        | ✗       |
| **Log / text files** (.log, .txt) | ✓        | ✗       |

### Channel attachment limitation

Microsoft Teams does not forward any attachments to bots in channel messages — file uploads go to the channel's SharePoint folder and images are referenced in a way the bot can't fetch. Anything you want the bot to analyze must be shared in a **1-1 chat** with the bot.

This is a Teams platform limitation, not a Gurubase configuration option.

### File reuse within a conversation

Within the same 1-1 conversation context (between rotations), files you've already shared stay available for follow-up questions — you don't need to re-upload a PDF every time you want to ask about it. The bot tags inherited references with a `(from earlier)` badge so it's clear which sources came from previous messages.

***

## Updating an existing bot

If you change anything in the bot's manifest (scopes, name, icon, description, messaging endpoint registered in the manifest, etc.) after publishing, Teams won't pick up the change until you republish:

<Steps>
  <Step title="Bump the version">
    In your app on `dev.teams.microsoft.com`, open **Basic information** and increment the **Version** field (e.g. `1.0.1` → `1.0.2`). Teams aggressively caches manifests by version; without a bump, the change won't propagate.
  </Step>

  <Step title="Publish to your org">
    Open **Publish → Publish to your org** in the sidebar and click **Publish your app** again.
  </Step>

  <Step title="Re-approve in the admin center">
    Go to the [Teams admin center → Manage apps](https://admin.teams.microsoft.com/policies/manage-apps), find your bot, and click **Publish** on the new pending version. It can take a couple of minutes to propagate to Teams clients.
  </Step>
</Steps>

<Note>
  Changing the bot's **credentials** in Gurubase (rotating the client secret, switching tenants) is separate from this flow — that's done from the Gurubase integration page, no Teams republish needed.
</Note>

***

## Disconnecting

Clicking **Disconnect** on the Gurubase integration page deletes the credentials Gurubase stores and stops the bot from receiving / replying to messages. It does **not** remove the bot app from Teams — users will still see it in their app list until you uninstall it from the [Teams admin center → Manage apps](https://admin.teams.microsoft.com/policies/manage-apps). For a clean uninstall, do both: disconnect in Gurubase, then remove the app in the admin center.

***

## Troubleshooting

| Symptom                                                | Cause / Fix                                                                                                                                                                                |
| ------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `AADSTS700016` when connecting                         | Tenant ID doesn't match your bot's AAD tenant. Double-check the Tenant ID from Step 12.                                                                                                    |
| `AADSTS7000215` or `AADSTS7000216`                     | Invalid client secret. Generate a new one in Step 5 and copy the **Value** (not the Secret ID).                                                                                            |
| Bot does not reply in a channel                        | You must mention the bot (`@<bot-name>`) in channels. Plain channel messages aren't forwarded to the bot.                                                                                  |
| Attachment posted in a channel didn't reach the bot    | Teams limitation — no attachments (files or images) are forwarded to bots in channels. Share them in a 1-1 chat instead.                                                                   |
| App doesn't appear in Teams admin center               | The org publish can take a few minutes. Refresh after a minute or two.                                                                                                                     |
| Manifest update isn't reflected in Teams               | See [Updating an existing bot](#updating-an-existing-bot) — every change needs a version bump and a re-publish through the admin center.                                                   |
| `@bot-name` in a channel does nothing                  | You typed it as plain text. Use `@` and pick the bot from the autocomplete dropdown so Teams registers it as a real mention.                                                               |
| Bot was removed in Gurubase but still appears in Teams | Disconnecting only severs the credentials; the app stays installed. Remove it from the [Teams admin center](https://admin.teams.microsoft.com/policies/manage-apps) for a clean uninstall. |
