Microsoft Teams
Start agents from chats and mentions in Microsoft Teams through your own Azure Bot, and post their answers in the conversation or a channel.
On this page
| Modes | Inbound, outbound |
| YAML type | teams |
| Credentials | A Connection of type teams with the Microsoft App ID, tenant ID, and client secret of your own single-tenant Azure Bot |
| Bridge | Not supported |
| Custom domain | Not supported |
| Linked agents | One or more. A message starts every linked agent. |
| While paused | Messages start no runs. Outbound sends nothing. |
Set up
Create a single-tenant Azure Bot with the Microsoft Teams channel, and copy its Microsoft App ID, its App Tenant ID, and the value of a client secret.
In Project Settings → Connections, click New connection and choose Microsoft Teams. You can also create the Connection from the Connection picker in the connector form.
Under Bot, enter a Connection name, the Bot name that people see in Teams, the Microsoft App ID, the Tenant ID, and the Client secret. Turn on Receive all channel messages if the agents should get every message in a team's channels, not only mentions. Click Create connection; connic signs in as the bot to check the values before it saves them.
Under Messaging endpoint, copy the URL connic shows. In the Azure portal, paste it as the Messaging endpoint on the bot's Configuration page and apply. Click Continue.
Under Teams app, click Download app package and upload the package to Teams; see Teams app. Add the app to the teams, group chats, and people that should use it, then click Done.
Open the agent. In Connector Flow, click Add inbound connector for messages or Add outbound connector for replies and posts. Then click Create New Connector and choose Microsoft Teams.
Choose the mode, Inbound (Messages) or Outbound (Send Messages), and pick the Connection under Connection. For outbound, optionally paste a Default channel. Click Create. For outbound, then choose how the agent uses the connector and click Link connector.
In code
Declare the connector in connectors/*.yaml. connection names the Connection that holds the bot. Inbound connectors need no config; outbound connectors take an optional channel.
type: teams
mode: inbound
connection: support-bot # Connection with the Azure Bot
agents:
- helpdesktype: teams
mode: outbound
connection: support-bot
config:
channel: https://teams.microsoft.com/l/channel/19%3A7c41e2a9b3d8%40thread.tacv2/Announcements
agents:
- name: helpdesk
outbound: { usage: automatic }Configuration
The fields of a Microsoft Teams connector, the same in connectors/*.yaml, the REST API, and connic MCP. The Microsoft Teams Connection they name must have finished its setup in the dashboard; until then, the deploy or request fails. The descriptions name the matching setting in the dashboard. Connectors in code describes the fields every connector shares, such as agents and environments.
| Field | Type | Status | Description |
|---|---|---|---|
| type | string | Required | teams. |
| mode | string | Required | inbound or outbound. Dashboard: Mode. |
| connection | string | Required | Inbound and outbound. Name or ID of a Microsoft Teams Connection whose setup is complete. See Azure Bot. Dashboard: Connection. |
| config | object | Optional | Microsoft Teams settings. Inbound connectors have none. |
| channel | string | Optional | Outbound. The channel for runs that didn't start in Teams: a link from Get link to channel in Teams, or a channel ID such as 19:7c41e2a9b3d8@thread.tacv2. Dashboard: Default channel. |
The bot's name, its credentials, and Receive all channel messages belong to the Connection, not to the connector.
Generated values
connic generates these on the Connection, so every connector that uses the Connection shares them.
| Value | Modes | Description |
|---|---|---|
| Messaging endpoint | Inbound, outbound | Where Teams sends the bot's messages, one URL per Connection: https://connect.connic.co/teams/<connection id>. You enter it on the bot's Configuration page in the Azure portal. |
| Teams app package | Inbound, outbound | A zip with manifest.json and the app icons, to upload in Teams. Download app package in the Connection's drawer downloads it. |
| Installed teams | Inbound, outbound | The teams the app was added to, as Teams reports the installs. The Connection's drawer lists them. |
Agent input
Modes: Inbound
An inbound connector starts a run for every linked agent with each message someone sends the bot in a chat with it, and with each message that mentions the bot in a channel or group chat. With Receive all channel messages on, every message in the channels of teams that added the app starts runs, not only mentions. connic acknowledges each message to Teams right away and runs the agents afterwards. The run receives:
{
"text": "Can I carry unused vacation days into next year?",
"conversation_id": "teams:19:4f2a9c1e7b3d@thread.tacv2;messageid=1794873600000",
"conversation_type": "channel",
"mentioned": true,
"sender": {
"id": "29:1kXz7Qv3mJt0aB8yRwE2",
"aad_object_id": "5b0e8c4d-2f6a-4e1b-9c3d-7a8f1e2d4b6c",
"name": "Jana Weber"
},
"team": { "id": "19:8d3e5f7a9b1c@thread.tacv2", "name": "People" },
"channel": { "id": "19:4f2a9c1e7b3d@thread.tacv2", "name": "Ask HR" },
"message_id": "1794873600000",
"raw": { ... }
}textis the message text with the bot's mention removed.conversation_idisteams:followed by the Teams conversation ID. It stays the same for every message in one chat and in one channel thread. To give the agent the earlier messages as history, setsession.key: input.conversation_idin its YAML; the connector doesn't turn on sessions by itself.conversation_typeispersonalfor a chat with the bot,groupChat, orchannel.mentionedistruewhen the message mentions the bot.senderis the person who wrote the message: their Teams user ID, their Microsoft Entra object ID, and their display name.teamandchannelare the team and channel of a channel message, andnullin chats.message_idis the message's ID in Teams, andrawthe full activity as Teams sent it, including the details of attachments.
Every inbound connector on a Connection receives every message the bot gets. To start several agents, link them to one inbound connector; to keep environments apart, give each environment its own bot and Connection. Messages from outside the bot's tenant are ignored, and a message that Teams delivers twice doesn't start another run. Files and images aren't downloaded or passed to the agent as files. Inbound mode doesn't reply by itself: to answer in the conversation, link the agent to an outbound Teams connector that uses the same Connection; see Outbound delivery.
Azure Bot
connic talks to Teams as your own Azure Bot. Microsoft no longer allows new multi-tenant bots, so the bot is single-tenant and serves only your Microsoft Entra tenant. Its credentials live on the Connection, not on the connector, and connic stores them encrypted. One Connection serves any number of inbound and outbound connectors.
In the Azure portal, create an Azure Bot. Choose Single Tenant as the type of app and create a new Microsoft App ID.
On the bot's Configuration page, copy the Microsoft App ID and the App Tenant ID.
Click Manage Password on the same page. Under Certificates & secrets of the app registration, create a client secret and copy its value.
Under Channels, add the Microsoft Teams channel. Without it, Teams can't reach the bot.
| Setting | Description |
|---|---|
| Bot name | The name people see for the bot in Teams, at most 30 characters. |
| Microsoft App ID | From the bot's Configuration page. |
| Tenant ID | The App Tenant ID from the bot's Configuration page. |
| Client secret | The value of a client secret from Certificates & secrets of the bot's app registration, not its secret ID. |
| Receive all channel messages | Optional, off by default. Every message in the channels of teams that added the app reaches the inbound connectors, not only mentions. See Teams app. |
connic signs in as the bot to check the Microsoft App ID, tenant ID, and client secret before it saves the Connection. The client secret expires: create a new one in time and enter it in the Connection. The Connection is set up in the dashboard; connectors in code, the REST API, and connic MCP use it by name or ID.
Teams app
People reach the bot through a Teams app that carries the bot's name. connic builds the app package from the Connection: a zip with manifest.json and the app icons. Download it with Download app package in the Connection's drawer and upload it in one of two places:
- In the Teams admin center, under Teams apps → Manage apps → Upload new app.
- In Teams as a custom app, under Apps → Manage your apps → Upload an app → Upload a custom app. This needs custom app upload to be allowed in the tenant.
Then add the app to the teams, group chats, and people that should use it. Teams tells connic when the app is added to a team, and the Connection's drawer lists those teams. connic also learns from these reports where to post, so a default channel works only once the app is installed in the channel's team.
With Receive all channel messages on, the app asks for the resource-specific permission to read all messages in a team's channels. A team owner consents when adding the app to the team. From then on, every message in that team's channels reaches the inbound connectors, not only mentions. In group chats, only mentions arrive.
Changing the bot name, the Microsoft App ID, or Receive all channel messages gives a new package version. Download the package again and upload it as an update of the same app.
Outbound delivery
Modes: Outbound
An outbound Teams connector posts one message each time it's used: when a linked agent's run completes, when the model calls it as a tool, or when middleware calls it, depending on the link's usage. The first rule that applies decides where:
- When the run came in through an inbound Teams connector on the same Connection, it replies in that conversation: in the chat, or in the same thread of a channel.
- Otherwise it posts a new message in the connector's Default channel. This needs the app installed in the channel's team.
When neither applies, the delivery fails with an error that says so.
Automatic output
An automatic link posts the run's final output. Plain text becomes the message. A JSON object takes the message from text, body, message, response, or output, in that order. Teams renders Markdown in the message.
{
"text": "**Up to 5 unused days** carry over into next year. They expire on March 31."
}Agent-tool and middleware payload
The model or middleware passes text, which is required and can't be empty. Other fields are rejected. connic adds the bot's credentials, the default channel, and the conversation to reply in, none of which the model sees.
{
"text": "Your laptop request is approved. IT will contact you about pickup."
}Delivery and retries
When Teams asks connic to slow down or answers that it's briefly unavailable, connic waits and sends the message again. When Teams' answer is lost or Teams reports another server error, connic doesn't send the message again; check the conversation. The connector's runs show each delivery, or its error.
Limits and errors
| Limit | Value |
|---|---|
| Answer to Teams | Teams expects an answer within a few seconds. connic acknowledges every message right away and runs the agents afterwards, so the agent's answer arrives as a separate message. |
| Messages to Teams | 7 per second and 1,800 per hour per bot and conversation, set by Microsoft. When Teams asks to slow down, connic waits and sends the message again. |
| Bot name | 30 characters |
| Files in messages | Not downloaded and not passed to the agent. Their details are only in raw. |
| Tenant | The bot's own tenant. Messages from other tenants are ignored. |
connic checks that every request comes from Microsoft for your bot and answers 401 otherwise. Saving a Connection fails when Microsoft Entra ID rejects the bot's sign-in, for example because of a wrong client secret or a bot that isn't single-tenant. Creating a connector fails while the Connection's setup isn't complete. After the client secret expires, deliveries fail until you enter a new one in the Connection. A delivery also fails when Teams rejects the message, for example because the app isn't installed in the team or chat, and when the run didn't start in Teams and the connector has no default channel.