Setup starts in Mattermost, moves to Microsoft Teams, and ends in Mattermost.
Install the Microsoft Teams integration in Mattermost#
Important
These installation instructions assume you already have a Mattermost instance running PostgreSQL. Note that this Mattermost integration doesn’t support MySQL databases.
Log in to your Mattermost workspace as a system administrator.
Download the latest version of the plugin binary release, compatible with Mattermost v9.8.0 and later. If you are using an earlier version of Mattermost, follow our documentation to upgrade to Mattermost v9.8.0 or later.
Go to System Console > Plugins > Plugin Management > Upload Plugin, and upload the plugin binary you downloaded in the previous step.
Go to System Console > Plugins > Plugin Management. In the Installed Plugins section, scroll to MS Teams, and select Enable Plugin.
Set up an OAuth application in Azure#
Sign into portal.azure.com using an admin Azure account.
Navigate to App Registrations.
Select New registration at the top of the page.
Fill out the form with the following values:
Name:
Mattermost MS TeamsSupported account types:
Default value (Single tenant)Platform:
WebRedirect URI:
https://(MM_SITE_URL)/plugins/com.mattermost.msteams/oauth-redirect
Replace (MM_SITE_URL) with your Mattermost server’s Site URL. Select Register to submit the form.
Navigate to Certificates & secrets in the left pane.
Select New client secret. Enter the description and select Add. After the creation of the client secret, copy the new secret value, not the secret ID. We’ll use this value later in the Mattermost System Console.
Navigate to API permissions in the left pane.
Select Add a permission, then Microsoft Graph in the right pane.
Select Delegated permissions, and scroll down to select the following permissions:
Channel.ReadBasic.All
ChannelMessage.Read.All
ChannelMessage.ReadWrite
ChannelMessage.Send
Chat.Create
Chat.ReadWrite
ChatMessage.Read
Directory.Read.All
Files.Read.All
Files.ReadWrite.All
offline_access
Team.ReadBasic.All
User.Read
Select Add permissions to submit the form.
Next, add application permissions via Add a permission > Microsoft Graph > Application permissions.
Select the following permissions:
Channel.ReadBasic.All
ChannelMessage.Read.All
Chat.Read.All
Files.Read.All
Group.Read.All
Team.ReadBasic.All
User.Read.All
Application.ReadWrite.OwnedBy(orApplication.Read.All)
Select Add permissions to submit the form.
Select Grant admin consent for… to grant the permissions for the application.
Ensure you have the metered APIs enabled (and the pay subscription associated to it)#
Follow the steps here: https://learn.microsoft.com/en-us/graph/metered-api-setup
Important
If you don’t configure the metered APIs, you must use the Evaluation model (configurable in Mattermost) that is limited to a low rate of changes per month. We strongly recommend that you avoid using the Evaluation model configuration in live production environments because you can stop receiving messages due the rate limit. See this Microsoft documentation for more details.
You’re all set for configuration inside Azure.
Mattermost configuration#
With the Tenant ID, Client ID, and Client secret noted above, the Mattermost plugin is ready for configuration. See the Microsoft Teams plugin configuration settings documentation for support in completing the base configuration.
Create a user account to act as a bot#
A connected bot is required to sync linked channels.
Create a regular user account. We will connect this account later from the Mattermost side.
This account is needed for proxying messages from Mattermost to Microsoft Teams.
As a system administrator, run the
/msteams connect-botslash command to connect the bot account, authenticating with the Teams account created above.
Monitor performance#
You can set up performance monitoring and performance alerting for this plugin using Prometheus and Grafana.
Monitoring enables you to proactively review the overall health of the plugin, including database calls, HTTP requests, and API latency.
Alerting enables you to detect and take action as issues come up, such as the integration being offline.
Grafana dashboards are available on GitHub for Mattermost Cloud deployments as a useful starting point. These dashboards are designed for use in Mattermost Cloud, and filter to a given namespace.
Note
Modifications will be necessary for self-hosted Mattermost deployments. See the Get help section below for details on how to contact us for assistance.
System admin slash commands#
Once Microsoft Teams interoperability is enabled, the following slash commands are available for Mattermost system admins by typing the commands into the Mattermost message text box, and selecting Send:
/msteams connect-bot: Connect the bot account in Mattermost to an account in Microsoft Teams./msteams disconnect-bot: Disconnect the bot account in Mattermost from the Microsoft Teams account./msteams show-links: Show all the currently active links including the Mattermost team, Mattermost channel, Microsoft Teams team, and Microsoft Teams channel.