Deploy Your Agent
Microsoft Teams
Deploy your thinnestAI agent to Microsoft Teams as a bot for workplace conversations.
Microsoft Teams
Add your agent to Microsoft Teams as a bot. Users can chat with it in channels or direct messages within their Teams workspace.
Prerequisites
- An Azure account with access to Azure Bot Service
- A Microsoft 365 organization with Teams
- Admin permissions to install apps in Teams
- Your agent created and tested in thinnestAI
Setup
Step 1: Create an Azure Bot
- Go to Azure Portal
- Click Create a resource > search for Azure Bot
- Click Create
- Fill in:
- Bot handle: A unique name (e.g.,
acme-ai-assistant) - Subscription: Your Azure subscription
- Resource group: Create new or use existing
- Pricing tier: F0 (Free) for testing
- Microsoft App ID: Create new
- Bot handle: A unique name (e.g.,
- Click Review + Create > Create
Step 2: Get App Credentials
- After creation, go to your bot resource
- Navigate to Configuration
- Copy the Microsoft App ID
- Click Manage Password > New client secret
- Copy the Client Secret (save it — you can't see it again)
Step 3: Configure Your Agent
- Open your agent in thinnestAI
- Go to the Deploy tab
- Select Teams
- Enter:
- App ID — The Microsoft App ID from Azure
- App Password — The client secret
- Click Save & Enable
Step 4: Set the Messaging Endpoint
- In Azure Portal, go to your bot's Configuration
- Set the Messaging endpoint to:
https://api.thinnest.ai/webhooks/teams/YOUR_AGENT_ID- Click Apply
Step 5: Add Teams Channel
- In your Azure Bot, go to Channels
- Click Microsoft Teams
- Accept the Terms of Service
- Click Apply
Step 6: Install in Teams
- In Azure Bot > Channels > Microsoft Teams, click Open in Teams
- Or search for your bot by name in the Teams app store
- Click Add to install the bot
Step 7: Test It
Send a message to your bot in Teams. It should respond within seconds.
How It Works
User sends message in Teams
↓
Teams sends activity to /webhooks/teams/{agent_id}
↓
thinnestAI verifies Azure JWT token
↓
Extracts user info → auto-captures lead
↓
Routes message to agent (GraphExecutor)
↓
Agent responds → sent back via Teams Bot APISession Persistence
Each Teams conversation gets its own session. The agent remembers the full conversation history within a conversation thread.
Session ID format: teams_{conversation_id}
Automatic Lead Capture
Every Teams user is automatically captured as a lead with:
- Name: Display name from Teams profile
- User ID: Teams/Azure AD user identifier
- Conversation ID: Stored in custom fields
- Platform:
teams - Deduplication: One lead per Teams user per agent
Bot Mentions
In channels, users must @mention the bot to trigger a response. The mention text is automatically stripped from the message before it's sent to your agent.
Security
- Azure JWT verification: Every incoming webhook is verified using Azure Bot Service JWT tokens
- App credentials required: Both App ID and App Password must be configured — requests are rejected without them
- Credential encryption: App Password is encrypted at rest
Supported Activities
| Activity Type | Supported | Description |
|---|---|---|
message | Yes | Text messages from users |
conversationUpdate | Partial | Member added/removed events |
messageReaction | Not yet | Reactions to messages |
invoke | Not yet | Card actions |
Troubleshooting
| Issue | Solution |
|---|---|
| No response | Verify messaging endpoint URL is correct |
| "missing credentials" | Add App ID and App Password in agent config |
| "unauthorized" | Verify App ID/Password match Azure portal |
| "teams not enabled" | Enable Teams in agent Deploy settings |
| Bot not found in Teams | Check the Teams channel is added in Azure |
| Slow responses | Complex agents may take time — consider simplifying instructions |
| Empty messages ignored | The bot strips @mentions; if nothing remains, it returns silently |