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

# Microsoft Teams

> Connect your Microsoft tenant, then install the Current bot with the app package.

The Microsoft Teams integration is the longest installation of the five. It has two parts, and you need a Teams administrator for the second part.

Read this page completely before you start. The two parts look independent, and they are not.

## Why there are two parts

| Part           | What it does                                                                                                         | Who installs it            |
| -------------- | -------------------------------------------------------------------------------------------------------------------- | -------------------------- |
| The connection | Maps your Microsoft tenant to your Current workspace. Current uses it to find your workspace when a message arrives. | A Current workspace admin. |
| The bot        | Sends and receives the Teams messages. It arrives in an app package.                                                 | Your Teams administrator.  |

<Warning>
  The bot answers nothing until both parts are complete. The connection alone delivers no messages, and the app package alone finds no workspace. Do the two parts in the order below.
</Warning>

## Before you start

You need three things:

* The **admin** role in the Current workspace.
* A Microsoft account in the tenant that your team uses.
* A Teams administrator, who opens the Teams admin center and uploads an app.

Speak to your Teams administrator first. Part 2 waits for that person, and an upload plus a policy change takes time in most organizations.

## Part 1: Connect the tenant

<Steps>
  <Step title="Open the Integrations page">
    In the portal, go to **Settings** > **Integrations**.
  </Step>

  <Step title="Connect Microsoft Teams">
    Find the **Microsoft Teams** row. Click **Connect**.
  </Step>

  <Step title="Sign in to Microsoft">
    Sign in with an account of your tenant. Read the permission list and give your consent.

    If your tenant asks for an approval of a new application, Microsoft sends the request to a Microsoft administrator. The connection completes after that person gives the consent.
  </Step>

  <Step title="Confirm the connection">
    The browser comes back to the **Integrations** page.

    <Check>
      The **Microsoft Teams** row shows the green **Connected** badge.
    </Check>

    Click the chevron at the end of the row. The details give the account, the user, and the tenant ID. Confirm that the tenant ID is your tenant.
  </Step>
</Steps>

<Note>
  The bot answers no message yet. Part 1 identifies your tenant. Continue to Part 2.
</Note>

### What Current asks for

| Permission              | Why Current needs it                                   |
| ----------------------- | ------------------------------------------------------ |
| `offline_access`        | Keep the connection without a new sign-in each day.    |
| `User.Read`             | Read the name of the account and identify your tenant. |
| `Team.ReadBasic.All`    | See the list of the teams.                             |
| `Channel.ReadBasic.All` | See the list of the channels.                          |
| `ChannelMessage.Send`   | Send a message into a channel.                         |

## Part 2: Install the app package

The app package is a zip file. It holds the app manifest and the icons of the bot. A Current workspace admin downloads it, and a Teams administrator uploads it.

<Steps>
  <Step title="Download the app package">
    Go to **Settings** > **Integrations**. Click **App package** on the **Microsoft Teams** row.

    The browser downloads the file. The file name holds the name of your workspace, for example `current-teams-acme-corp.zip`.

    <Note>
      The **App package** button shows for every workspace admin, and it does not wait for Part 1. Complete Part 1 first. A bot without a connection finds no workspace.
    </Note>

    If the download reports `The Teams bot is not configured on this server.`, your Current server holds no bot credentials. Speak to your Current contact. The app package cannot work without them.
  </Step>

  <Step title="Give the file to your Teams administrator">
    Send the zip file to the person who administers Microsoft Teams.

    <Warning>
      A changed file fails the upload. Send the zip file as you received it. Do not open it and do not repackage it.
    </Warning>
  </Step>

  <Step title="Upload the app">
    The administrator opens the Teams admin center, goes to **Teams apps** > **Manage apps** > **Upload new app**, and uploads the zip file.
  </Step>

  <Step title="Set the availability to Everyone">
    The administrator opens the app in **Manage apps** and sets its availability to **Everyone**.

    <Warning>
      The bot receives no message when an app permission policy blocks the app. The installation still looks complete, so this failure is hard to find. The availability controls the delivery of the messages, not only the installation. Set it to **Everyone**. Do not keep the org-wide default of your tenant.
    </Warning>
  </Step>

  <Step title="Add the bot in Teams">
    A member opens Teams and adds **Current**: in a chat, in a team, or in a group chat. Search for the app by name.
  </Step>
</Steps>

<Note>
  Teams refuses the upload with `This app has already been submitted in your org` when the app is already in your catalog. Every app package from one Current server carries the same app id, so your organization holds one copy.

  To replace it, the administrator selects the app in **Manage apps** and uploads the new package. Teams accepts a new package only with a higher version number.
</Note>

## Verify the installation

<Steps>
  <Step title="Open a chat with the bot">
    In Teams, open a direct chat with **Current**. Use a direct chat for this test. A direct chat needs no mention, so it tests the fewest things at one time.
  </Step>

  <Step title="Send a message">
    Write a message, for example "What projects are late?".
  </Step>

  <Step title="Read the answer">
    The bot adds the 👀 reaction to your message. The reply follows.

    <Check>
      The 👀 reaction confirms that the message reached Current. The reply confirms that both parts operate.
    </Check>
  </Step>
</Steps>

If no reaction and no reply arrive, see [Troubleshooting](/troubleshooting#microsoft-teams).

## When the bot answers

This table is the most useful part of the page. In Teams, the bot does one of three things with a message. It answers the message, it records the message without a reply, or it never receives the message.

| Where you write                                                     | What the bot does                                            |
| ------------------------------------------------------------------- | ------------------------------------------------------------ |
| A direct chat with the bot                                          | It answers each message.                                     |
| A group chat, with a mention of the bot                             | It answers the message.                                      |
| A group chat, with no mention                                       | It drops the message.                                        |
| A channel thread, with a mention of the bot                         | It answers the message.                                      |
| A channel thread that mentioned the bot before, with no new mention | It records the message and sends no reply.                   |
| A channel thread, with no mention and no earlier mention            | Teams sends the message to no one. The bot receives nothing. |

<Warning>
  The bot gives no answer in a channel without a mention. Mention the bot in each channel message that needs an answer, including a message in a thread that the bot already answered.
</Warning>

The fifth row surprises people. The bot reads a follow-up message of a thread that it answered before, and it keeps that message as context. It sends no reply to it. Mention the bot again to get an answer.

<Note>
  The `ChannelMessage.Read.Group` permission removes the mention requirement. The app package asks for no such permission. It is a resource-specific consent, and a team owner gives it when the owner adds the bot to a team.
</Note>

## Files in a chat

Teams attaches no file to a bot message. The delivery therefore has one more step, and your team must know about it.

| Where you are              | What happens                                                                                               |
| -------------------------- | ---------------------------------------------------------------------------------------------------------- |
| A direct chat with the bot | The reply arrives first. Each file follows as an offer. Click **Accept** to receive the file.              |
| A group chat or a channel  | The agent sends no file. Teams supports the offer in a direct chat only. The agent names the file instead. |

<Warning>
  A file arrives only after you click **Accept**. A file that you ignore never arrives. The agent says so in its reply.
</Warning>

To send a file to the agent, attach it to your message. The agent reads the text of a document, and it sees an image. The agent opens at most 5 files for each message, and each file up to 10 MB.

## Remove the integration

Go to **Settings** > **Integrations**. Click **Disconnect** on the **Microsoft Teams** row, then confirm.

A disconnection removes the token from Current. It removes no app from Teams. To remove the bot as well, your Teams administrator selects **Current** in **Teams apps** > **Manage apps** and blocks or removes the app.

## Questions you may have

<AccordionGroup>
  <Accordion title="I connected the tenant, and the bot answers nothing.">
    Part 1 is complete and Part 2 is not. The connection identifies your tenant. The bot arrives in the app package.

    Confirm three things, in this order: the row shows **Connected**, your Teams administrator uploaded the package, and the availability of the app is **Everyone**.
  </Accordion>

  <Accordion title="Why does my administrator have to upload a file? Why is Current not in the store?">
    The app package holds the address of your Current server. Every server produces its own package, so the app goes into the catalog of your organization and not into the public store.
  </Accordion>

  <Accordion title="Does every member install the app?">
    No. Your Teams administrator uploads the package one time, and sets the availability to **Everyone**. Each member then adds **Current** to a chat or a team, in the same way as any other Teams app.
  </Accordion>

  <Accordion title="The bot answered in the thread yesterday. Today it gives no answer.">
    The thread needs a new mention. The bot reads a follow-up message of a thread that it answered before, and it sends no reply to it.

    Mention the bot in your message.
  </Accordion>

  <Accordion title="The agent said it sent a file, and no file arrived.">
    In a direct chat, click **Accept** on the offer. Teams delivers the file after your consent.

    In a group chat or a channel, the agent sends no file. Ask the agent again in a direct chat.
  </Accordion>
</AccordionGroup>
