Sophon Docs
Channels

Microsoft Teams

Connect Sophon to Microsoft Teams via Bot Framework.

Sophon connects to Microsoft Teams using the Azure Bot Framework. You'll register a bot in Azure, configure the messaging endpoint, and enable the Teams channel.

Prerequisites

  • A Microsoft Azure account
  • A Microsoft 365 tenant with Teams enabled
  • Admin access to create app registrations in Azure AD

Step-by-Step Setup

1. Create an App Registration

  1. Go to Azure Portal > App registrations
  2. Click New registration
  3. Set:
    • Name: Sophon Bot
    • Supported account types: Accounts in any organizational directory (multi-tenant) or single tenant as needed
    • Redirect URI: Leave blank
  4. Click Register
  5. Copy the Application (client) ID — this is your appId

2. Create a Client Secret

  1. In your app registration, go to Certificates & secrets
  2. Click New client secret
  3. Set a description (e.g., "Sophon Bot Secret") and expiry
  4. Click Add and copy the Value immediately — you won't see it again

3. Create an Azure Bot

  1. Go to Azure Portal > Create a resource and search for Azure Bot
  2. Click Create
  3. Set:
    • Bot handle: sophon-bot
    • Pricing tier: F0 (Free)
    • Microsoft App ID: Use the app registration from step 1 (paste the Application ID)
    • App type: Multi Tenant (or Single Tenant)
  4. Click Review + Create > Create

4. Configure the Messaging Endpoint

  1. In the Azure Bot resource, go to Configuration
  2. Set the Messaging endpoint to:
    https://your-domain.com/api/channels/teams/messages
  3. Click Apply

For local development:

ngrok http 8080
# Use: https://xxxx.ngrok.io/api/channels/teams/messages

5. Enable the Teams Channel

  1. In the Azure Bot resource, go to Channels
  2. Click Microsoft Teams
  3. Accept the terms and click Apply

6. Configure in Sophon Dashboard

  1. Go to Channels and click Add Channel
  2. Select Microsoft Teams
  3. Enter the Bot App ID (Application/client ID)
  4. Enter the Bot App Password (client secret value)
  5. Optionally set the Tenant ID (use common for multi-tenant)
  6. Click Test Connection
  7. Click Activate

7. Install the Bot in Teams

  1. In Teams, go to Apps > Manage your apps > Upload a custom app
  2. Or add the bot by its App ID through the Teams admin center
  3. Start a chat with the bot

Configuration Reference

FieldTypeRequiredDefaultDescription
appIdtextYesApplication (client) ID from Azure app registration
appPasswordsecretYesClient secret value
tenantIdtextNocommonAzure AD Tenant ID (common for multi-tenant)

channels.json Example

{
  "id": "teams-bot",
  "type": "teams",
  "name": "Sophon Teams Bot",
  "enabled": true,
  "config": {
    "appId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "appPassword": "<encrypted>",
    "tenantId": "common"
  },
  "routing": {
    "agentId": "default",
    "dmBehavior": "main-session",
    "groupBehavior": "mention-only"
  },
  "status": "connected"
}

Troubleshooting

  • "Unauthorized" (401) — The App ID or secret is wrong, or the secret has expired. Generate a new secret in Azure > Certificates & secrets.
  • Bot not responding in Teams — Verify the messaging endpoint URL is correct and publicly accessible. Check that the Teams channel is enabled in the Azure Bot resource.
  • "BotNotInConversationRoster" — The bot needs to be installed in the team or chat first. Upload the app package or add it via the Teams admin center.
  • Multi-tenant auth errors — If using single-tenant, set tenantId to your specific Azure AD tenant GUID instead of common.
  • Messages delayed — Teams has its own delivery guarantees. If Sophon is slow to respond, check your LLM provider health and response time.