> For the complete documentation index, see [llms.txt](https://docs.autommate.com/userguide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autommate.com/userguide/ai-agent-composer/choose-and-connect-an-agent-channel/teams-ai-agent-channel.md).

# Connect an AI Agent to Microsoft Teams

Connect Teams to an existing AI Agent so users can ask questions and invoke its configured skills without leaving their conversation. The Teams bot carries messages; the AI Agent supplies the model, knowledge and skill configuration.

## Before you connect

Prepare an AI Agent in [AI Agent Composer](/userguide/ai-agent-composer/configure-an-agent-in-ai-agent-composer.md), test it in [Playground](/userguide/ai-agent-composer/test-in-playground-and-review-logs.md), and have an Azure Bot and Teams app available in your organisation. You also need permission to configure that bot and install or distribute the Teams app. If these do not exist, complete [Set up a Teams bot](/userguide/administration-and-runtimes/teams-bot-setup.md) first.

Use the channel's generated webhook for this route. A generic webhook-triggered Hyperflow used to test a bot is a separate backend; do not accidentally leave Azure pointing to that test flow when enabling the AI Agent.

```mermaid
flowchart LR
  T[Teams conversation] --> B[Azure Bot / Teams channel]
  B --> W[Generated AI Agent webhook]
  W --> A[Configured AI Agent]
  A --> K[Knowledge retrieval]
  A --> H[Configured Hyperflow skills]
  H --> S[Connected systems]
  K --> R[Agent response]
  S --> R
  R --> T
```

## Configure the channel

1. Open the intended agent in **AI Agent Composer**.
2. Open **Channels** and select **Microsoft Teams**.
3. Copy the displayed **Webhook URL**. Preserve the complete generated value, including any authentication parameters. Treat it as a credential where it contains a key; do not put it in public documentation or a chat message.
4. In the Azure Bot resource, open **Configuration** and set **Messaging Endpoint** to that URL. Save, then reopen the field to confirm the saved value.
5. Return to the channel setup and select an existing **Microsoft Teams credential** or create one. Use the bot's **Tenant ID**, **App ID** and **Client Secret** through the credential configuration, as described in the [bot setup guide](/userguide/administration-and-runtimes/teams-bot-setup.md).
6. Complete the channel configuration and install the Teams app for your test user using the approved organisational route.

## Test the complete conversation

Start with a simple message to confirm a response travels through the connected agent. Next, ask for a known knowledge item. Finally test one explicitly permitted skill against a test record.

For each test, check the AI Agent response, any associated Hyperflow run and the target system's result. A friendly response is not proof that the correct agent, credential or record was used. Keep the first write small and inspect its returned identifier.

If the assistant is meant to act for the signed-in user, validate how the Teams identity maps to the application's user. Installing a Teams bot does not automatically configure delegated access in ServiceNow, Xurrent or another system.

## Diagnose common connection problems

| Symptom                                             | Check first                                                                       |
| --------------------------------------------------- | --------------------------------------------------------------------------------- |
| App is unavailable in Teams                         | Teams app installation/availability policy and the app's selected scopes.         |
| Messages reach a test reply instead of the AI Agent | The Azure messaging endpoint may still point at a generic test Hyperflow.         |
| No reply after sending a message                    | Saved endpoint, credential selection, bot App ID and Teams channel configuration. |
| Agent replies but its skill fails                   | Inspect the Hyperflow action log and downstream credential/permissions.           |
| User can retrieve the wrong person's data           | Review identity mapping, skill input validation and target-system filtering.      |

Use the [ServiceNow](/userguide/start-here/use-cases/servicenow-agent-example.md), [Xurrent](/userguide/start-here/use-cases/xurrent-agent-example.md) or [ServiceDesk Plus](/userguide/start-here/use-cases/servicedesk-agent-example.md) example to define the first useful support journey.
