Share via

Guidance Needed: Integrating Microsoft Teams Bot with External Agentic Platform (Chat + Calling + OAuth-based Installation)

Shivi Krishna 0 Reputation points
2026-02-17T08:14:53.0166667+00:00

Hello everyone,

We are integrating Microsoft Teams with our enterprise agentic AI platform (Origon) and would appreciate guidance on the recommended architecture and APIs.

Context

  • Our Teams app/bot will be installed after the user completes OAuth on our platform
  • Messages will be sent by the bot (not on behalf of the user)
  • Our platform will drive conversations programmatically via LLM agents

Requirements

1. Teams as a channel

We want Teams to function as a bidirectional channel:

  • Inbound chat → routed to our platform
  • Outbound bot messages → sent back into Teams
  • Support for:
    • Personal chats
    • Channel messages

2. Bot-driven messaging

Our agents should be able to programmatically trigger the bot to:

Send proactive messages

Reply in existing conversations

Notify specific users

We plan to store conversation references after installation.

3. Calling support (future phase)

We are also evaluating:

Inbound Teams calls into our AI platform

Bot-initiated or bot-handled calling scenarios

Guidance on whether this should use:

  • Teams Calling APIs
  • Azure Communication Services
  • Or another recommended approach would be helpful.

Clarifications we’re seeking

  1. Is the Teams Bot Framework + Microsoft Graph the correct primary architecture for this pattern?
  2. For proactive messaging:
    • Is storing conversation references the recommended approach?
    • Any scale or tenant boundary considerations?
  3. For OAuth-based installation:
    • Best practice to ensure the bot is properly installed in the user’s scope after consent
    • Any pitfalls with multi-tenant deployments
  4. For real-time calling integration:
  5. Recommended reference architecture for external AI media processing If anyone has implemented a similar external AI orchestration with Teams, pointers to samples or docs would be greatly appreciated.

Thanks in advance!

Microsoft Teams | Development
Microsoft Teams | Development

Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs

0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. TiNo-T 11,770 Reputation points Microsoft External Staff Moderator
    2026-02-17T08:51:25.4033333+00:00

    Dear @Shivi Krishna,

    Welcome to Microsoft Q&A Forum!

    Thank you for your detailed inquiry and for outlining your requirements so clearly. I appreciate the thoughtful questions. Below I’ve addressed each of your main points with the currently recommended approaches (based on Microsoft’s latest Bot Framework, Graph APIs, and best practices). I've included direct links to official documentation and samples for your reference and further reading. You can check to see if they can give you some insights:

    1.Is the Teams Bot Framework + Microsoft Graph the correct primary architecture for this pattern? May be Yes, this may remain the most robust and officially recommended architecture for your scenario.

    • Bot Framework SDK handles the core conversation flow, activity processing, and bidirectional messaging (inbound from Teams > Origon and outbound from Origon > Teams).
    • Microsoft Graph extends this for advanced capabilities: proactive app installation after OAuth consent, managing permissions in multi-tenant environments, and calling/meetings features.

    This combination gives you full control from Origon while staying fully compliant with Teams platform rules. Reference: Teams bots overview

    2.Proactive messaging - Storing conversation references:

    Storing ConversationReference objects is still the standard and recommended approach for proactive/bot-initiated messaging (personal chats, replies in threads, notifications).

    Best practices & scale considerations:

    • Capture and persist the full ConversationReference (including serviceUrl, conversationId, tenantId, userId / aadObjectId) right after app installation or the first user interaction.
    • Store them in a secure, scalable database (e.g. Cosmos DB, PostgreSQL) with tenantId as a partition key for multi-tenant safety.
    • Important: Always include tenantId in references to prevent cross-tenant issues.
    • For large-scale/org-wide messaging, combine with Microsoft Graph proactive installation to automatically install the app for users who haven’t interacted yet.
    • Watch for 403 Forbidden errors (user blocked the bot or uninstalled the app) and maintain a per-user status report.

    You can see this article: Send proactive messages - Teams and Sample: bot-proactive-messaging (Teams Toolkit/Node.js)

    3.OAuth-based installation - Some practices and multi-tenant pitfalls:

    Recommended flow:

    • User completes OAuth consent in Origon (using Entra ID / Azure AD multi-tenant app registration).
    • After successful consent, your backend calls Microsoft Graph to proactively install the Teams app in the user’s personal scope (via teamsAppInstallation endpoint).
    • Capture the resulting conversation reference immediately.

    Common pitfalls to avoid in multi-tenant deployments:

    • Do not hardcode serviceUrl - always use the one provided in incoming activities (fallback to cloud-specific global URLs only when necessary).
    • Register your Azure AD app as multi-tenant and handle tenant-specific endpoints (especially important for GCC / GCC High / DoD clouds).
    • Ensure admin consent is granted where required for Graph permissions (e.g. TeamsAppInstallation.ReadWriteForUser.All).
    • Map Origon user identities <=> Teams userId / aadObjectId carefully to prevent authorization issues.

    Please see this article: Proactive app installation using Graph and Sample: graph-proactive-installation (C#)

    1. Real-time calling integration (future phase)For bot-handled or bot-initiated calling scenarios with external AI processing, the preferred options are:
    • Microsoft Graph Calls API > Best for native Teams experience (1:1, group calls, PSTN, mid-call controls). Suitable for simpler scenarios.
    • Azure Communication Services (ACS) > Recommended when you need advanced/low-latency media processing (real-time transcription, custom IVR, heavy AI orchestration in Origon). ACS can interoperate with Teams calls.
    • Hybrid approach (most common in enterprise AI cases): Use Graph to participate in the call > route media streams to Origon for processing > send responses back via Graph.

    I also advise starting with Graph Calling APIs and moving to ACS when media processing requirements become more intensive.

    Please see this article: Calls and online meetings bots overview and ACS plus Teams interop: Teams interoperability - Azure Communication Services

    I hope this information can give you some insights with your concerns. Wish you a pleasant day!


    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. 

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.