Building, integrating, or customizing apps and workflows within Microsoft Teams using developer tools and APIs
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(includingserviceUrl,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
tenantIdas a partition key for multi-tenant safety. - Important: Always include
tenantIdin 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 Forbiddenerrors (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
teamsAppInstallationendpoint). - 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/aadObjectIdcarefully to prevent authorization issues.
Please see this article: Proactive app installation using Graph and Sample: graph-proactive-installation (C#)
- 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.