This documentation describes the integration of MindsDB with Microsoft Teams, the ultimate messaging app for your organization. The integration allows MindsDB to access data from Microsoft Teams and enhance it with AI capabilities.
Before proceeding, ensure the following prerequisites are met:
Establish a connection to Microsoft Teams from MindsDB by executing the following SQL command and providing its handler name as an engine.
Required connection parameters include the following:
client_id
: The client ID of the registered Microsoft Entra ID application.client_secret
: The client secret of the registered Microsoft Entra ID application.tenant_id
: The tenant ID of the Microsoft Entra ID directory.Optional connection parameters include the following:
permission_mode
: The type of permissions used to access data in Microsoft Teams. Can be either delegated
(default) or application
.The delegated
permission mode requires user sign-in and allows the app to access data on behalf of the signed-in user. The application
permission mode does not require user sign-in and allows the app to access data without a user context. You can learn more about permission types in the Microsoft Graph permissions documentation.
Note that application permissions generally require higher privileges and admin consent compared to delegated permissions, as they allow broader access to organizational data without user context.
Microsoft Entra ID was previously known as Azure Active Directory (Azure AD).
Follow the instructions below to set up the Microsoft Teams app that will be used to connect with MindsDB.
Register an application in the Azure portal
Accounts in any organizational directory (Any Azure AD directory - Multitenant)
option under Supported account types.application
permission mode you may skip this step, but if you are using delegated
permissions, select Web
as the platform and enter URL where MindsDB has been deployed followed by /verify-auth under Redirect URI. For example, if you are running MindsDB locally (on https://localhost:47334), enter https://localhost:47334/verify-auth in the Redirect URIs field.delegated
permission mode:
application
permission mode:
If you already have an existing app registration, you can use it instead of creating a new one and skip the above steps.
Configure a MS Teams data souce in the MindsDB Editor
CREATE DATABASE
statement as shown above.Retrieve data from a specified table by providing the integration and table names:
The above example utilize teams_datasource
as the datasource name, which is defined in the CREATE DATABASE
command.
teams
: The table containing information about the teams in Microsoft Teams.channels
: The table containing information about the channels in Microsoft Teams.channel_messages
: The table containing information about messages from channels in Microsoft Teams.chats
: The table containing information about the chats in Microsoft Teams.chat_messages
: The table containing information about messages from chats in Microsoft Teams.