Teams Bot Setup
The Outpost Teams bot uses the Bot Framework SDK (botbuilder) and Azure Bot
Service webhooks to monitor conversations, create support tickets, and deliver AI-powered
responses with Adaptive Cards in Microsoft Teams.
Overview
The Teams integration registers as an Azure Bot Service application that receives messages via webhooks. When a customer sends a message in a monitored channel or chat, the bot triages it with AI, searches the knowledge base, and replies with rich Adaptive Cards — all while syncing tickets to the Outpost dashboard.
Register an Azure Bot
- Go to the Azure Portal and create a new Azure Bot resource
- Choose Multi Tenant for the bot type
- Under Configuration, note the Microsoft App ID — this is
TEAMS_APP_ID - Click Manage Password and create a new client secret — this is
TEAMS_APP_PASSWORD - Note your Azure AD Tenant ID — this is
TEAMS_TENANT_ID - Set the Messaging endpoint to
https://your-domain.com/api/teams/messages - Go to Channels and enable the Microsoft Teams channel
Environment Variables
Add these to your .env file:
# Teams Bot
TEAMS_APP_ID=your-microsoft-app-id
TEAMS_APP_PASSWORD=your-client-secret
TEAMS_TENANT_ID=your-azure-ad-tenant-id
# Team member detection
TEAM_MEMBER_IDS=aad-object-id-1,aad-object-id-2
Local development: Use ngrok or the Teams Toolkit to tunnel webhooks to your local machine. The bot listens on port 3003 by default.
Features
Message Monitoring
The bot receives messages via the Bot Framework webhook endpoint. When a customer posts in a monitored Teams channel, Outpost automatically:
- Detects whether the author is a team member or external customer
- Runs AI triage to classify priority and category
- Searches the knowledge base for relevant answers
- Replies with an Adaptive Card containing the AI-generated response
- Creates a ticket in the Outpost dashboard linked to the conversation
Conversation Tracking
Once a conversation is linked to a ticket, all subsequent replies are tracked and synced to the Outpost dashboard. The bot maintains conversation references so it can proactively send updates when ticket status changes.
AI Responses
Responses are delivered as Adaptive Cards with structured formatting, making them visually distinct from regular messages and easy to interact with.
Adaptive Cards
The bot uses three types of Adaptive Cards:
Response Cards
AI-generated answers are rendered as Adaptive Cards with action buttons:
- "Issue Solved" — marks the ticket as resolved
- "Need more help" — escalates to a team member
Ticket-Created Cards
When a new ticket is created, the bot posts a confirmation card showing the ticket ID, priority, and a link to the Outpost dashboard.
Escalation Cards
When a ticket is escalated, the assigned team member receives a card with the full conversation context, ticket details, and quick-action buttons for reassignment or priority changes.
Team Member Detection
The TEAM_MEMBER_IDS environment variable contains a comma-separated list of
Azure AD object IDs for your support team. The bot uses this list to:
- Skip AI triage for messages from team members
- Track team member responses as internal replies on the ticket
- Calculate response time metrics (first reply from a team member)
Finding Azure AD object IDs: In the Azure Portal, go to Azure Active Directory → Users, click on a user, and copy their Object ID from the overview page.
Health Check Endpoint
The Teams bot exposes a health check endpoint on port 3003:
GET :3003/health/teams
# Response
{ "status": "ok", "connected": true, "tenant": "your-tenant-id" }