Skip to main content
With LangSmith Fleet, each agent can have its own Microsoft Teams bot. Once connected, the agent can:
  • Start a run when someone messages the bot in a personal chat, or @mentions it in a channel or group chat.
  • Reply in the Teams conversation and read the thread for context.
  • Access Teams channels and messages through Microsoft Graph tools.
Each bot works with one agent.

Choose a setup path

Add to Teams in one click

On LangSmith Cloud, sign in to Microsoft and Fleet creates the bot in your organization.

Use your own Azure Bot

Create an Azure Bot yourself and connect it to Fleet. Use this path on self-hosted LangSmith.

Add a Teams bot in one click

On LangSmith Cloud, Fleet creates the agent’s bot in your Microsoft organization and connects it to the agent.

Requirements

  • A saved agent in Fleet that you can edit.
  • A Microsoft work account that can register apps in Microsoft Entra ID.
  • An Azure subscription with a resource group where that account can create resources.
To create the bot, LangSmith asks Microsoft for permission to create app registrations, add apps to your organization’s Teams app catalog, and manage Azure resources as the person who signs in. These permissions need an administrator’s consent. The first time anyone in your Microsoft organization adds a bot, an Application Administrator, Cloud Application Administrator, or Global Administrator must sign in and consent on behalf of the organization. After that, other people can add bots without an administrator.

Add the bot

1

Open Microsoft Teams in the agent's channels

In Fleet, open your agent. In the sidebar, expand the Channels drawer, connect a channel, and select Microsoft Teams.If Fleet opens the Azure Bot setup instead of showing Add to Teams, follow Use your own Azure Bot.
2

Sign in to Microsoft

Click Add to Teams. The bot takes the agent’s name, shortened to 30 characters. Sign in with your work account in the Microsoft tab that opens.
3

Choose where the Azure Bot goes

Choose an Azure subscription, then a resource group, and click Create the bot.
4

Wait for setup to finish

Setup can take a few minutes. When it finishes, Fleet shows Added to Teams, connects the bot to the agent, and adds the Teams tools.
Fleet creates these resources in your organization, each showing the bot’s name:
  • App registration in Microsoft Entra ID, which the bot signs in as. Fleet stores a client secret for it.
  • Azure Bot on the free (F0) tier in the subscription and resource group you chose, with the Microsoft Teams channel turned on. By adding the bot, you agree to Microsoft’s terms of service for the Teams channel.
  • Teams app for the bot in your organization’s app catalog.
If setup fails, Fleet shows the reason and an error code. Anything it created but could not remove is listed under Finish in Microsoft, with a link to each resource. If setup stops before it finishes, open the agent’s Microsoft Teams channel again and click Continue to pick up where it stopped.

Get the bot approved in Teams

How the bot reaches Teams depends on who signed in:
  • A Teams admin: Fleet publishes the bot’s Teams app to your organization. In Teams, open Apps, then Built for your org, and add the bot.
  • Anyone else: Fleet submits the Teams app for approval. A Teams admin approves it under Pending approval in the Teams admin center. People can then add the bot from Apps > Built for your org.
Until someone adds the bot in Teams for the first time, the agent’s Channels row shows Waiting for Teams admin. If no one has added it after 2 days, Fleet suggests asking your Teams admin whether they approved it. If a Teams admin rejects the app, Fleet shows that it was rejected.

Remove a one-click bot

Only the person who connected the bot can remove it, and they must be able to edit the agent. To remove the bot:
  1. In the agent’s Channels drawer, open the menu on the Microsoft Teams row and click Delete.
  2. Click Sign in and remove, then sign in with an account in the bot’s Microsoft organization.
Fleet deletes the bot’s Teams app, Azure Bot, and app registration from Microsoft, then removes the channel from the agent. If Microsoft refuses to delete any of them, Fleet lists them under Finish in Microsoft, with a link to each. For example, only a Teams admin can remove a published Teams app. Until it is removed, people can still add the bot in Teams, but it does not respond. If you sign in to a different Microsoft organization, nothing is removed.

Delete an agent that has a one-click bot

Deleting the agent deletes its bot’s credentials from LangSmith without a Microsoft sign-in. The bot’s Teams app, Azure Bot, and app registration stay in your organization, and Fleet lists what to remove there after you delete the agent. To remove the bot from Microsoft as well, the person who connected it can click Remove the Teams channel first instead in the delete dialog.

Use your own Azure Bot

Create an Azure Bot yourself, connect it to Fleet, and install it in Teams. Use this path on self-hosted LangSmith, or when you want to manage the bot in Azure yourself.

Prerequisites

  • A saved agent in Fleet that you can edit. An unsaved agent shows Save your agent first to add a Teams bot. See Quickstart to create one.
  • An Azure account with permission to create resources.
  • Permission to upload and install custom apps in your Microsoft Teams organization. Your Teams administrator may need to enable custom app uploading.

Set up the bot

1

Create an Azure Bot resource

  1. Go to the Azure Portal.
  2. Search for Azure Bot and click Create.
  3. Fill in the required fields:
    • Bot handle: A unique identifier for your bot.
    • Subscription: Select your Azure subscription.
    • Resource group: Create a new one or select an existing one.
    • Pricing tier and Data residency: Choose settings for your organization. See Azure Bot pricing and regionalization. A regional bot alone does not guarantee end-to-end data residency.
    • Type of App: Select Single Tenant.
    • Creation type: Select Create new Microsoft App ID.
  4. Click Review + create, then Create.
Azure no longer allows new Multi Tenant bots.
2

Get your app credentials

After the resource is created:
  1. Navigate to your bot resource and click Configuration in the left sidebar. Azure Bot overview with Configuration highlighted in the sidebar
  2. Copy the Microsoft App ID and the App Tenant ID for the Fleet setup wizard. Azure Bot configuration with the messaging endpoint, Microsoft App ID, and App Tenant ID highlighted
  3. Click Manage Password next to the App ID.
  4. Click New client secret, add a description, and click Add.
  5. Copy the secret Value, not the secret ID. The value is only shown once; if you lose it, create a new secret.
3

Configure the Azure connection

  1. Open the Fleet setup wizard from either place:
    • From the agent: In the agent’s Channels drawer, connect a channel and select Microsoft Teams. If Fleet offers Add to Teams, click Use your own Azure bot instead.
    • From Integrations: In Fleet, open Integrations > Apps > Microsoft Teams and click Add Teams bot. In some workspaces, open Integrations > Slack & Teams and click Add Teams Bot.
  2. Copy the webhook URL from the first screen of the Fleet wizard.
  3. In your Azure Bot resource, go to Configuration. Paste the URL into Messaging endpoint and click Apply. Streaming Endpoint is not required.
  4. Go to Channels, select Microsoft Teams, and agree to the terms of service.
  5. On the Messaging tab, select the cloud environment for your Teams organization and click Apply.
  6. Confirm Microsoft Teams appears in the connected channels list and check its status. Azure Bot Channels sidebar and connected Microsoft Teams channel with healthy status highlighted
Enable the Teams channel for every new Azure Bot, including a replacement. Uploading an app package does not enable it.
For details, see Connect a bot to Microsoft Teams.
4

Register and link the bot

  1. Return to Fleet, click Continue to Credentials, and enter:
    • Bot display name: A name for the bot.
    • Azure App ID (Client ID): The Microsoft App ID from Azure.
    • Azure Tenant ID: The App Tenant ID from Azure. Use the GUID, not a domain name or your Fleet workspace ID.
    • Client Secret (App Password): The secret value you copied.
    Fleet Teams bot credentials form with the Azure Tenant ID and client secret fields highlighted
  2. Click Continue, then Download Teams App Package. Keep the ZIP for installation. Fleet wizard screen highlighting Download Teams App Package and Continue
  3. Click Continue, choose the agent, and click Finish. The list shows only agents you can edit. If you started from the agent’s Channels drawer, click Save & Connect instead.
When you finish, Fleet checks the App ID, tenant ID, and client secret with Microsoft. If Microsoft refuses them, Fleet returns to the credentials step and says what to fix. See Fleet refuses the bot’s credentials. On success, Fleet displays Teams bot configured successfully.
Downloading the ZIP or clicking Continue does not save the bot. Click Finish or Save & Connect before testing or installing the bot in Teams.
5

Install and test the bot in Teams

  1. In Teams, go to Apps > Manage your apps > Upload an app.
  2. Select Upload a custom app and choose the ZIP downloaded from Fleet. Teams Manage your apps page with Apps, Upload an app, and Upload a custom app highlighted
  3. Follow your organization’s approval process if required, then add the app to a team or chat.
  4. Send a message and confirm the agent replies. In channels and group chats, @mention the bot.
If you recreate the Azure Bot with a new App ID, download a new package for that bot. Do not reuse a package for the deleted bot.

Remove your own Azure Bot

Only the person who connected the bot can remove it, and they must be able to edit its agent. In the agent’s Channels drawer, open the menu on the Microsoft Teams row, click Delete, then click Remove. LangSmith deletes the stored client secret and the agent’s Teams channel. The bot stays in Azure, where you can delete it if you no longer need it. Deleting the agent does the same.

Move a bot to another agent

Each Teams bot belongs to the agent you added it to and only works with that agent. Integrations lists your workspace’s Teams bots and their agents. Manage each bot from its agent’s Channels drawer. To use a bot with a different agent, remove it and add it again:
  • One-click bot: Remove it, then add a new bot from the other agent’s Channels drawer.
  • Your own Azure Bot: Remove it, then connect it to the other agent with the same App ID, tenant ID, and a client secret.

Who the agent runs as

Teams works with agents of either identity. The account a Teams message runs the agent as depends on its identity and who it is shared with:
  • Fixed credentials, shared with the whole workspace: Anyone in a conversation with the bot can use it. The agent runs as the person who connected the bot, with the agent’s own accounts.
  • Any other agent: Each person links their Microsoft account to LangSmith once, and their messages run the agent as them, with their own connected accounts. They must be a member of the agent’s workspace. Unless the whole workspace can run the agent, they must also be its owner or someone it is shared with.
To link a Microsoft account:
  1. Message the bot. If your Microsoft account is not linked, the bot replies with a link to LangSmith.
  2. Open the link and click Sign in with Microsoft, using the account you use in Teams.
  3. When LangSmith shows Linked, go back to Teams and send your message again.
If a linked person cannot run the agent, the bot replies that the agent is private. When a run needs you to connect an account, the bot posts a card in the conversation with a button for each account. Connect them, then send any message in the conversation to continue. When a run waits for an approval, the card asks you to respond in Fleet.

Add Teams tools

When you connect a bot to an agent, Fleet adds two tools:
  • Teams Bot Reply (teams_reply_to_message): Sends a reply to the originating Teams conversation. A response in Fleet alone is not a Teams reply.
  • Teams Read Thread (teams_read_thread_messages): Reads the conversation’s thread for context.
Both use the bot’s credentials and do not require separate Microsoft Graph authorization. To read channels or take other Teams actions, add the relevant Teams tools in the agent’s Connections drawer. Microsoft Graph tools may require authorization. The teams_bot_send_proactive_message tool is for messages outside a direct reply, such as notifications.

Troubleshooting

Resolve installation errors

Teams can report InvalidUserId with “Incorrect bot configuration/registration, please check the bot settings.” This message alone does not identify the cause. Before recreating the bot or changing settings, check the following:
  • Azure and Fleet: Confirm the Teams channel is enabled for the correct cloud. Verify the bot’s App ID, tenant ID, and Single Tenant app type. Use the same IDs in Fleet.
  • App package: In the ZIP’s manifest.json, check that bots[].botId matches the Azure Bot’s App ID. The top-level id identifies the Teams app and can differ from the bot ID.
  • Teams organization: Install in the intended organization and confirm its policies allow the custom app.
To test without installing the package, open Channels > Microsoft Teams in the Azure Bot resource. Use Open in Teams, or select Get bot embed code and open the Teams HTTPS test link. Send a message with the same bot, account, and organization, and check for a reply. This optional diagnostic is not for production distribution. It may require custom-app upload permission, and the embed code is unavailable in some clouds. If a chat does not open, check the Azure registration, Teams channel, and policies. If it opens but no reply arrives, check Fleet, the messaging endpoint, and credentials. If the reply works but package installation fails, check the package and policies. A personal-chat reply does not verify team or group-chat installation. If the error persists, collect the following for support:
  • The exact failure time and time zone, the step reached, and an error screenshot.
  • The failed request URL, HTTP status, error response, and request or correlation IDs, if available.
  • The Azure Bot’s App ID, App Tenant ID, app type, and Teams channel status and cloud environment.
  • The exact app ZIP used for the failed installation.
Do not share client secrets, access tokens, cookies, authorization headers, or unredacted network captures. Redact credentials before sharing screenshots or request details.

Fleet refuses the bot’s credentials

When you connect your own Azure Bot, Fleet checks its credentials with Microsoft and shows what Microsoft refused:
  • Copy the Application (client) ID and the Directory (tenant) ID from the app registration’s Overview page. Both are GUIDs.
  • Use the client secret’s Value, not its Secret ID. A secret added in the last few minutes can take a minute to work.
  • If the secret has expired, add a new one under Certificates & secrets and use its value.
Fleet also refuses a bot that is already connected:
  • Connected in another LangSmith workspace: Remove it from that workspace first.
  • Already connected in this workspace: Delete it from Integrations, then add it again.

Agent does not respond

  • Check the Fleet run for a teams_reply_to_message call and its result. If the tool is missing, add it to the agent. If the agent does not call it, update its instructions and test again. Instructions do not guarantee a tool call.
  • Check the Fleet thread for approvals, the Feed tab for errors, and whether the agent’s channels are paused.
  • If the bot replies with a link to your Microsoft account or says the agent is private, see Who the agent runs as.
  • In channels and group chats, @mention the bot and confirm the app is installed in that team or group chat.
  • For a one-click bot that shows Waiting for Teams admin, ask a Teams admin whether they approved its Teams app, or add the bot from Apps > Built for your org.
  • For your own Azure Bot, verify the Azure messaging endpoint matches Fleet’s webhook, and confirm the client secret has not expired in Azure. To use a new secret, remove the bot and add it again.