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

  1. Go to the Azure Portal and create a new Azure Bot resource
  2. Choose Multi Tenant for the bot type
  3. Under Configuration, note the Microsoft App ID — this is TEAMS_APP_ID
  4. Click Manage Password and create a new client secret — this is TEAMS_APP_PASSWORD
  5. Note your Azure AD Tenant ID — this is TEAMS_TENANT_ID
  6. Set the Messaging endpoint to https://your-domain.com/api/teams/messages
  7. Go to Channels and enable the Microsoft Teams channel

Environment Variables

Add these to your .env file:

.env env
# 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:

  1. Detects whether the author is a team member or external customer
  2. Runs AI triage to classify priority and category
  3. Searches the knowledge base for relevant answers
  4. Replies with an Adaptive Card containing the AI-generated response
  5. 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:

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:

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:

HTTP bash
GET :3003/health/teams

# Response
{ "status": "ok", "connected": true, "tenant": "your-tenant-id" }