Microsoft Teams Integration
Bring your knowledge base into Microsoft Teams with a powerful bot that answers questions, syncs channel content, and integrates with your M365 ecosystem.
Features
| Feature | Description |
|---|---|
| Bot Framework | Native Teams bot with Adaptive Cards |
| Channel Sync | Index team channels and conversations |
| @Mentions | Respond when mentioned in channels |
| 1:1 Chat | Private conversations with the bot |
| Meeting Integration | Access knowledge during meetings |
| Adaptive Cards | Rich, interactive responses |
| SSO | Single sign-on with Azure AD |
Prerequisites
- Microsoft 365 subscription
- Teams admin access (for org-wide deployment)
- Azure AD app registration
Setup
Step 1: Azure AD App Registration
- Go to Azure Portal > App Registrations
- Click New Registration
- Configure:
- Name: \LH42 Teams Bot\
- Supported account types: \Accounts in this organizational directory only\
- Redirect URI: \https://app.lakehouse42.com/api/auth/teams/callback\
- Note the Application (client) ID and Directory (tenant) ID
- Create a client secret:
- Go to Certificates & secrets
- Click New client secret
- Copy the secret value
- Add API permissions:
- \User.Read\ - Sign in and read user profile
- \ChannelMessage.Read.All\ - Read channel messages (delegated)
- \Chat.Read\ - Read user chat messages
- \TeamsActivity.Send\ - Send activity notifications
Step 2: Configure in LH42
- Go to Settings > Integrations > Microsoft Teams
- Enter your Azure AD credentials:
\\\`python
client.integrations.teams.configure({
"azure_ad": {
"tenant_id": "your-tenant-id",
"client_id": "your-client-id",
"client_secret": "your-client-secret"
},
"bot": {
"app_id": "your-bot-app-id",
"app_password": "your-bot-password"
}
})
\\\`
Step 3: Deploy the Bot
Option A: Admin deployment (recommended)
- Download the Teams app manifest from LH42
- Go to Teams Admin Center > Manage apps
- Upload the custom app
- Configure policies for org-wide deployment
Option B: Sideload for testing
- In Teams, go to Apps > Upload a custom app
- Upload the manifest .zip file
- Add the bot to a team or chat
Using the Bot
@Mentions in Channels
\\\`
@LH42 What's our expense reimbursement process?
\\\`
1:1 Chat
Start a direct conversation with the bot for private queries:
\\\`
You: How do I request time off?
LH42: Based on the HR Policy document, here's the process:
1. Submit a request in Workday...
📄 Source: HR Policy v2.3, Page 15
\\\`
Slash Commands
\\\`
/lh42 search quarterly earnings
/lh42 summarize product-roadmap.pdf
/lh42 help
\\\`
Adaptive Card Responses
Responses use Microsoft Adaptive Cards for rich formatting:
\\\`json
{
"type": "AdaptiveCard",
"version": "1.4",
"body": [
{
"type": "TextBlock",
"text": "Here's what I found:",
"weight": "bolder",
"size": "medium"
},
{
"type": "TextBlock",
"text": "Based on the Employee Handbook...",
"wrap": true
},
{
"type": "FactSet",
"facts": [
{"title": "Source", "value": "Employee Handbook"},
{"title": "Confidence", "value": "High (0.92)"}
]
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "View Source",
"url": "https://..."
},
{
"type": "Action.Submit",
"title": "👍 Helpful",
"data": {"action": "feedback", "value": "positive"}
}
]
}
\\\`
Channel History Sync
Index Teams channel conversations:
\\\`python
client.connectors.configure("teams", {
"settings": {
"teams": ["team-id-1", "team-id-2"],
"channels": ["General", "Engineering"],
"include_replies": True,
"include_files": True,
"lookback_days": 90
}
})
\\\`
Webhook Architecture
Teams uses Bot Framework for webhooks:
\\\`
Teams Message → POST /api/gateway/teams/messages
│
├── Validate JWT (Azure AD issuer)
│
├── Parse Activity object
│
├── Queue to Inngest
│
└── Process async:
├── Identify conversation context
├── Query RAG pipeline
├── Generate Adaptive Card response
└── Reply via Bot Framework
\\\`
Single Sign-On (SSO)
Enable seamless authentication:
\\\`python
client.integrations.teams.configure({
"sso": {
"enabled": True,
"connection_name": "LH42-SSO",
"auto_provision_users": True
}
})
\\\`
Users are automatically authenticated using their M365 identity.
Meeting Integration
Access knowledge during Teams meetings:
- Meeting tab: Pin LH42 as a meeting tab
- Meeting chat: Bot responds in meeting chat
- Post-meeting: Auto-generate summaries (requires Zoom or transcript)
Security
| Aspect | Implementation |
|---|---|
| Authentication | Azure AD JWT validation |
| Authorization | M365 permission scopes |
| Token Storage | Encrypted per-organization |
| Audit | All interactions logged |
Troubleshooting
| Issue | Solution |
|---|---|
| Bot not responding | Verify bot is added to the team |
| "Not authenticated" | Check Azure AD configuration |
| Missing messages | Verify \ChannelMessage.Read.All\ permission |
| Card rendering issues | Check Adaptive Card version compatibility |
Next Steps
- Gmail Integration - Email integration
- Communication Overview - Architecture deep-dive