> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/conversations/teams.md).

# Integrate with Platform: Microsoft Teams

## Pre-Connection Checklist

* An "AI Assistant" has been created on the [MaiAgent platform](https://admin.maiagent.ai/)
* You have a Microsoft 365 account (Enterprise or Education edition)
* You have an [Microsoft Azure Portal](https://portal.azure.com/) account with admin permissions
* You have application registration permissions in Microsoft Entra ID (formerly Azure AD)

{% hint style="warning" %}
Teams Bot requires an organization-level Microsoft 365 account; personal accounts cannot be used.
{% endhint %}

***

## Step 1: Create a Bot Resource in Azure

### 1. Create an Azure Bot

Sign in to the [Azure Portal](https://portal.azure.com/), search for <mark style="color:blue;">AI Foundry</mark> (or Bot Services), find <mark style="color:blue;">Azure Bot</mark>, and click <mark style="color:blue;">Create</mark>.

### 2. Fill in the Bot Creation Form

| Field                | Description                                                 |
| -------------------- | ----------------------------------------------------------- |
| **Bot handle**       | Enter a unique Bot name (e.g., `MaiAgentTeamsBot`)          |
| **Subscription**     | Select your Azure subscription                              |
| **Resource group**   | Select an existing or create a new resource group           |
| **Pricing tier**     | F0 (Free) is recommended                                    |
| **Microsoft App ID** | Select "Create new Microsoft App ID" or use an existing one |

Click <mark style="color:blue;">Review + create</mark>, then confirm and click <mark style="color:blue;">Create</mark>.

***

## Step 2: Obtain the App ID and Password

### 1. Obtain the Microsoft App ID

After creation, go to the Azure Bot resource and click <mark style="color:blue;">Configuration</mark> to find the **Microsoft App ID**. Copy it for later use.

### 2. Create a Client Secret

Click <mark style="color:blue;">Certificates & secrets</mark> (or find the corresponding App in Microsoft Entra ID → App registrations), click <mark style="color:blue;">New client secret</mark>, set the description and expiration, then click <mark style="color:blue;">Add</mark>.

{% hint style="danger" %}
The client secret "Value" is displayed only once. Copy and securely store it immediately.
{% endhint %}

***

## Step 3: Configure API Permissions

### 1. Go to App Registrations

Search for <mark style="color:blue;">Microsoft Entra ID</mark> in the Azure Portal, go to <mark style="color:blue;">App registrations</mark>, and find the application corresponding to the Bot.

### 2. Add API Permissions

Click <mark style="color:blue;">API permissions</mark> in the left menu, then click <mark style="color:blue;">Add a permission</mark>.

### 3. Select Microsoft Graph

Select <mark style="color:blue;">Microsoft Graph</mark> → <mark style="color:blue;">Application permissions</mark>, search for `User.Read.All`, check it, and click <mark style="color:blue;">Add permissions</mark>.

### 4. Grant Admin Consent

Return to the API permissions page and click <mark style="color:blue;">Grant admin consent for {Organization Name}</mark>.

***

## Step 4: Create a Teams Chat Platform in MaiAgent

### 1. Go to Connect Chat Platform

Click <mark style="color:blue;">Chat Platforms</mark> in the MaiAgent left menu, click <mark style="color:blue;">Connect Chat Platform</mark>, and select <mark style="color:blue;">Azure Bot</mark> (i.e., Microsoft Teams).

### 2. Enter Basic Settings

| Field                      | Description                                            |
| -------------------------- | ------------------------------------------------------ |
| **Name**                   | Give this connection a name (required)                 |
| **AI Assistant**           | Select the AI Assistant to bind                        |
| **Microsoft App ID**       | Paste the Application ID obtained in Step 2 (required) |
| **Microsoft App Password** | Paste the client secret obtained in Step 2 (required)  |

### 3. Save and Obtain the Webhook URL

Click <mark style="color:blue;">Connect Chat Platform</mark> to complete the setup. The system will generate a **Webhook URL** — copy it for later use.

***

## Step 5: Return to Azure to Configure the Messaging Endpoint and Channel

### 1. Configure the Messaging Endpoint

Return to the Azure Bot resource, go to <mark style="color:blue;">Bot profile</mark> (Configuration), paste the **Webhook URL** generated by MaiAgent into the <mark style="color:blue;">Messaging endpoint</mark> field, and click <mark style="color:blue;">Apply</mark>.

### 2. Enable the Microsoft Teams Channel

Click <mark style="color:blue;">Channels</mark> in the left menu and confirm that the <mark style="color:blue;">Microsoft Teams</mark> channel is enabled and the status is Healthy.

***

## Step 6: Install the Bot in Teams

### Method 1: Upload via Teams Admin Center

To make the Bot available to all users in the organization, upload the App Manifest through the [Teams Admin Center](https://admin.teams.microsoft.com/):

1. Sign in to the [Teams Admin Center](https://admin.teams.microsoft.com/) and go to <mark style="color:blue;">Manage apps</mark>
2. Click <mark style="color:blue;">Upload new app</mark> and upload the Teams App Manifest (.zip file)

{% hint style="info" %}
Download the Teams App Manifest template from [Google Drive](https://drive.google.com/drive/folders/1E2i3y15oC65xu_5zFIXN7yG9KBgp34KB). You need to replace the Bot ID with your Microsoft App ID.
{% endhint %}

### Method 2: Search in Teams Apps

1. Open Microsoft Teams and click <mark style="color:blue;">Apps</mark> in the left menu
2. Search for your Bot name
3. Click <mark style="color:blue;">Open</mark> or <mark style="color:blue;">Add</mark> to install the Bot

***

## Getting Started

After installation, find the Bot in the Teams chat list and send a message to start interacting with the AI Assistant.

***

## Important Notes

{% hint style="warning" %}
**Security**

* Keep the client secret secure and never share it publicly
* Regularly rotate the client secret

**Limitations**

* The Bot must be @ mentioned in team channels to respond (not required in one-on-one chats)
* Azure Bot Service free tier (F0) can process 10,000 messages per month

**Troubleshooting**

* **Bot not responding**: Verify the Webhook URL (messaging endpoint) is configured correctly
* **Cannot find Bot in Teams**: Verify the Manifest has been uploaded and approved in Teams Admin Center
* **Permission errors**: Verify API permissions have been granted admin consent
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/conversations/teams.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
