How it Works
The Teams bot will be available in direct messages.
Preview
Supported Features
Message | Streaming | Elements | Audio | Ask User | Chat History | Chat Profiles | Feedback |
---|---|---|---|---|---|---|---|
✅ | ❌ | ✅ | ❌ | ❌ | ❌ | ❌ | ✅ |
Install the Botbuilder Library
The Botbuilder library is not included in the Chainlit dependencies. You will have to install it manually.Create a Teams App
To start, navigate to the App Management page. Here, create a new app.
Create a Teams App
Fill the App Basic Information
Navigate to Configure > Basic Information and fill in the basic information about your app. You won’t be able to publish your app until you fill in all the required fields.
Basic infos
Create the Bot
Navigate to Configure > App features and add the Bot feature. Create a new bot and give it the following permissions and save.
Bot permissions
Go to the Bot Framework Portal
Navigate to the Bot Framework Portal, click on the Bot you just created and go to the Settings page.Get the App ID
In the Bot Framework Portal, you will find the app ID. Copy it and set it as an environment variable in your Chainlit app.
Get the App ID
Working Locally
If you are working locally, you will have to expose your local Chainlit app to the internet to receive incoming messages to Teams. You can use ngrok for this.Set the Message Endpoint
Under Configuration, set the messaging endpoint to your Chainlit app HTTPS URL and add the/teams/events
suffix.

Messaging endpoint
Get the App Secret
On the same page, you will find a blue “Manage Microsoft App ID and password” button. Click on it.
Manage password
Support Multi Tenant Account Types
Navigate to Manage > Authentication and toggle “Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant)” then save.
Multi tenant
Start the Chainlit App
Since the Chainlit app is not running, the Teams bot will not be able to communicate with it. For the example, we will use this simple app:my_app.py
Reminder: Make sure the environment variables are set and that your local
chainlit app is exposed to the internet via ngrok.
Using -h to not open the default Chainlit UI since we are using Teams.
Publish the Bot
Back to the App Management page, navigate to “Publish to org” and click on “Publish”.
Publish
Authorize the Bot
The Bot will have to be authorized by the Teams admin before it can be used. To do so navigate to the Teams admin center and find the app.
Publish

Publish