DIAL Integration with Microsoft Teams
Introduction
This document provides a technical overview of the integration of the DIAL Platform with Microsoft Teams through custom bot implementation. It serves as a technical reference for developers interested in building similar integrations.
Note: The actual technical implementation, configuration and deployment are described at a high level and are out of scope of this document.
The Challenge and Our Solution
Modern workplaces rely on multiple specialized tools, but constantly switching between applications disrupts workflow and reduces productivity. We recognized that users needed access to DIAL's powerful AI capabilities without leaving their primary communication environment in Microsoft Teams.
Our solution: a custom MS Teams bot that creates a seamless bridge between these platforms.
We designed this integration to:
- Provide a consistent user experience across environments
- Function effectively in both private and group chat contexts
- Handle authentication appropriately for each scenario
Key benefits:
The DIAL-MS Teams integration delivers several important advantages:
- Unified Workflow Environment: Users can access DIAL models and tools directly within MS Teams conversations.
- DIAL Feature Access: Selected DIAL capabilities are available via bot, including model selection, conversation management, and Playback.
- Enterprise-Grade Security: Appropriate authentication and access control for different usage contexts.
- Flexible Collaboration Options: Support for both individual productivity and team collaboration scenarios.
By bringing DIAL's features directly into MS Teams, we have eliminated context switching, enhanced collaboration possibilities, and made sophisticated AI tools accessible within users' existing workflow. MS Teams users can now leverage powerful AI assistance without disrupting their communication processes.
What DIAL Bot for MS Teams Does
The functionality of DIAL chat bot for MS Teams is straightforward - it brings selected functionality from the DIAL Platform into your MS Teams chats while adhering to existing DIAL RBAC. Here's what users can do with it:
- Use any LLM or application available in DIAL based on a corresponding permission level.
- Access existing DIAL conversations directly in MS Teams.
- Manage conversations (clear history, switch between topics) and use the Playback feature.
Basically, users can do everything from simple questions to complex AI tasks without leaving MS Teams. It makes work easier by keeping everything in one place.
Implementation Highlights
Main Components
Our solution has three main parts:
- Microsoft Teams Client: MS Teams UI the user interacts with.
- DIAL Chat Bot Service: The middle-layer we built using Azure Bot SDK.
- DIAL Core API: The DIAL backend that does all the AI heavy lifting and processing of requests.
These components are connected through:
- Azure Bot Service handling the messaging infrastructure.
- MS Teams App Manifest defining the bot's presentation and capabilities within MS Teams.
Conversation Handling
The DIAL Chat Bot Service acts as a proxy service that converts communication between MS Teams client and the DIAL Platform. The bot receives events from MS Teams through the Azure Bot Service, which handles initial authentication and token verification. The Azure Bot Service processes these events and provides clean events to our application, such as notifications that a specific user sent a message in a particular chat. Our service takes these requests and forwards them to DIAL Core API, then transforms DIAL's responses into a format compatible with MS Teams. Since MS Teams doesn't support direct HTML formatting, we use Adaptive Cards to create interactive elements like combo boxes and checkboxes, when needed.
[Microsoft Teams] <--> [Azure Bot Service] <--> [DIAL Chat Bot Service] <--> [DIAL Core API]
The bot maintains conversation context by mapping MS Teams conversation IDs to appropriate DIAL sessions, allowing for continuity across interactions.
Media File Handling
The media handling implementation addresses several challenges in the file transfer between MS Teams and DIAL. When users send images in MS Teams, they may come in different formats: small images might be included directly in the message, while larger files might be uploaded to MS SharePoint with a link sent to the bot.
Our implementation detects these different formats, retrieves files as needed, and uploads them to DIAL. For files coming from DIAL that need to be displayed in MS Teams, we use Azure Blob Storage as an intermediary. Files are uploaded to the Blob Storage, and SAS (Shared Access Signature) tokens are generated to create secure but publicly accessible URLs. These URLs are then sent to MS Teams to display the content. An important limitation is that SAS tokens have an expiration time. This means that when a user returns to a conversation after the token has expired (typically after some period like a month), the files will no longer be accessible in the MS Teams chat history, although they remain available in the DIAL platform itself.
Authorization and Authentication
Refer to Access Control to learn how DIAL handles authentication and authorization.
The bot implements two different authentication approaches based on the conversation context:
In private chats, the bot acts on behalf of the individual user. The Azure Bot Framework assists with authentication, allowing the bot to configure how it works with DIAL. When needed, the framework handles the login process with the specified authentication provider and obtains a token, which the bot then uses to authenticate with the DIAL API. You can learn about authentication in DIAL in Tutorials.
In group chats, the bot uses a pre-configured API key instead of individual user credentials. This ensures a consistent experience for all members of the group but limits access to only those models and applications explicitly configured for the API key.
The Azure Bot Service helps with token management and authentication flows, allowing the implementation to focus on the core functionality of relaying information between MS Teams and DIAL.
Configuration and Deployment Highlights
Our specific bot’s implementation relies on:
- Azure Bot Registration: Configured with messaging endpoint for API communication.
- Azure App Service: Configuring App ID and Client Secret for the bot's identity.
- OAuth Connections: DIAL Platform connection for user authentication. Refer to Tutorials to learn about IDPs supported in DIAL.
- Microsoft Graph connection for MS SharePoint file access.
- Azure Key Vault: To store DIAL API keys, Azure App credentials, and Azure Storage connection strings.
- Kubernetes Deployment: Containerized bot service with environment-specific configuration.
- Ingress Configuration: Manages HTTP traffic with configured hostname and TLS support.
Technical Stack
- Bot Framework: Azure Bot Services/AI Foundry
- Development SDK: Azure Bot SDK (.NET was used in this particular implementation)
- Authentication: Microsoft Identity Platform, OAuth 2.0
- File Storage: Azure Blob Storage
- Deployment: Azure App Service
- Communication: REST APIs
- API Access: DIAL Core API credentials, Microsoft Graph permissions, MS Teams Bot permissions