Microsoft Teams Integration

Technical design for PraisonAI Microsoft Teams channel implementation

Run PraisonAI agents in Microsoft Teams channels via BotOS — enterprise collaboration with the same agent brain as Telegram and Discord.

python
import os
from praisonaiagents import Agent
from praisonai.bots import Bot

agent = Agent(
    name="Teams Assistant",
    instructions="Help users in Microsoft Teams channels.",
)

bot = Bot(
    "teams",
    agent=agent,
    app_id=os.getenv("TEAMS_APP_ID"),
    app_password=os.getenv("TEAMS_APP_PASSWORD"),
)
bot.run()

The user messages in Microsoft Teams; BotOS routes the conversation to the same agent used on other channels.

Diagram

Agent

Teams Bot

Bot Framework

Microsoft Teams

How It Works

Diagram
Microsoft Teams IntegrationAgentUserMicrosoft Teams IntegrationAgentUserRequestProcess requestResult Agent–>>User: Response

Quick Start

  1. Simple Usage
    python
    import os
    from praisonaiagents import Agent
    from praisonai.bots import Bot
    
    agent = Agent(
        name="Teams Assistant",
        instructions="Help users in Microsoft Teams channels.",
    )
    
    bot = Bot(
        "teams",
        agent=agent,
        app_id=os.getenv("TEAMS_APP_ID"),
        app_password=os.getenv("TEAMS_APP_PASSWORD"),
    )
    bot.run()
  2. With Configuration

    Add Teams to a multi-platform BotOS setup:

    python
    import os
    from praisonaiagents import Agent
    from praisonai.bots import BotOS
    
    agent = Agent(name="Assistant", instructions="Be helpful.")
    
    botos = BotOS(
        agent=agent,
        platforms={
            "teams": {
                "app_id": os.getenv("TEAMS_APP_ID"),
                "app_password": os.getenv("TEAMS_APP_PASSWORD"),
                "tenant_id": os.getenv("AZURE_TENANT_ID"),
            },
        },
    )
    botos.run()

Overview

This RFC proposes Microsoft Teams as a first-class PraisonAI messaging channel for enterprise RFPs and Microsoft 365-first organisations.

Success Criteria

  • Full BotOS protocol compatibility
  • Multi-agent deployment in Teams channels
  • Enterprise security and compliance features
  • Rich message formatting and adaptive cards
  • SSO and Azure AD integration

Architecture

Diagram

Agent

TeamsBot

Bot Framework SDK

Teams API

Microsoft Teams

Azure AD


Configuration

yaml
# teams-bot.yaml
platform: teams
app_id: ${TEAMS_APP_ID}
app_password: ${TEAMS_APP_PASSWORD}
tenant_id: ${AZURE_TENANT_ID}

agent:
  name: TeamsAssistant
  instructions: You are a helpful assistant in Microsoft Teams

features:
  adaptive_cards: true
  file_uploads: true
  threading: true

security:
  sso_enabled: true
  audit_logging: true

Implementation Plan

PhaseDurationScope
1 — Core Messaging4 weeksBot Framework SDK, send/receive, BotOS protocol
2 — Advanced Features3 weeksAdaptive cards, Azure AD, audit logging
3 — Production2 weeksTest suite, security audit, documentation

Security

LayerImplementation
AuthenticationAzure AD OAuth 2.0
EncryptionTLS 1.3 + Azure Key Vault
Audit trailAzure Monitor + PraisonAI logs
Rate limitingAzure API Management

Best Practices

Use Azure Key Vault for credentials

Store TEAMS_APP_ID and TEAMS_APP_PASSWORD in Key Vault — never commit secrets to source control.

Deploy AgentTeam across channels

Use AgentTeam for multi-agent Teams channels with session management per conversation.

Enable SSO for enterprise tenants

Configure Azure AD SSO so users authenticate with existing Microsoft 365 credentials.

Use adaptive cards for approvals

Human-in-the-loop workflows map cleanly to Teams adaptive card submit actions.


Related