Tags | Integrations | Microsoft Teams |
ADMIN PRIVILEGES REQUIRED
This documentation is for Stack Overflow for Teams Enterprise. Free, Basic, and Business users can access their documentation here. Find your plan.
Overview
The SOE (SOE) Microsoft Teams integration offers many useful features, including question and article lists, filter by tags per channel, convert posts into questions, a personal bot, and more. Read the Microsoft Teams Integration user guide for more info.
The Microsoft Teams integration requires two-way communication between your SOE site and Microsoft's servers. Information flowing from your site to Microsoft is rarely a problem. Information returning to your site from outside your network can be blocked, however, by firewall rules, proxy settings, or an IP address whitelist. For the Microsoft Teams integration to work, Microsoft servers must be able to establish a secure (HTTPS) connection to your site.
NOTE: The Microsoft Teams integration requires your SOE site to be accessible on the internet with a secure (HTTPS) connection. If inbound internet traffic can't reach your site for any reason, the integration will fail.
THIS ARTICLE APPLIES TO STACK OVERFLOW FOR TEAMS ENTERPRISE ONLY.
Other Stack Overflow for Teams users should read this article instead. Find your plan.
Create the Microsoft Teams bot
To configure the MS Teams integration, log into your SOE site and Microsoft Teams in separate browser tabs. Have a working document or note file open as well to hold configuration values.
NOTE: You must use Microsoft Teams in a browser to create the MS Teams bot. The Microsoft Teams desktop app will allow you to complete some—but not all—of the steps to configure the integration.
You'll start by using the Microsoft Teams Developer Portal to create a custom Stack Overflow bot. If you've already installed the Microsoft Teams Developer Portal app, skip down to the "Create a custom bot" section of this article. Otherwise, follow the steps below to install the Developer Portal app.
NOTE: Microsoft Teams has pre-built Stack Overflow apps, but they're not for SOE sites. Instead, you'll use the Microsoft Teams Developer Portal App Studio to create a custom bot for your unique SOE installation.
Install the Microsoft Teams Developer Portal app
NOTE: If you're using Microsoft GCC Regular, see the "Microsoft Government Community Cloud" (GCC) section at the end of this document. The MS Teams integration does not work with Microsoft GCC High or DoD environments.
In Microsoft Teams, click the three dots button (...) in the left-hand menu to bring up the installed apps list.
If Developer Portal doesn't appear in the list, type "Developer Portal" In the Search for apps box.
Click Developer Portal.
Create a custom bot
Unless you just installed Developer Portal (and it's already open), click the three dots button in the Microsoft Teams left-hand menu to bring up the installed apps list.
Click Developer Portal.
In the top menu, click Tools.
Click Bot management.
Click New Bot.
In the Add bot name field, enter "SOE", then click Add. The bot configuration screen appears.
Set Endpoint address to your site name plus /integrations/microsoft-teams/messages (for example: https://[your_site]/integrations/microsoft-teams/messages), then click Save.
Click Client secrets, then click Add a client secret for your bot. A new client secret will appear.
Use your mouse to select the client secret, and copy the secret to your clipboard. Paste the secret to a working document or note file for use later. Click OK.
NOTE: At the time this document was written, the client secret Copy to clipboard (clipboard and paper) button did not work. Use your mouse to select and copy the secret instead.
MS Teams will not display the client secret again after initial creation. Be sure to copy and paste it before leaving this screen. If you don't successfully save the secret, you'll need to delete it and create a new secret.
Click Bots to return to the Bot management screen. You should see your new bot.
Use your mouse to select and copy your new bot's Bot ID. Paste the ID to your document or note file. Be careful to not click on the bot entry itself, or the bot management page will open.
The Microsoft Teams Developer Portal will create the custom bot as a multi-tenant app registration in Azure by default. You don't need to modify any of the default settings. If your setup requires a single-tenant app registration, please contact support for alternate setup instructions.
Integrate the bot with SOE
With a new bot created and its ID and client secret copied, the next part of the integration process happens in SOE. Make sure you're logged in to your SOE site with administrator rights.
In the left-hand menu, click Admin settings.
Under the Integrations and apps heading, click Microsoft Teams.
Paste the bot ID from your working document or note into the Bot app ID field.
Paste the client secret into the Bot app password field.
Click Save credentials to save the bot credentials.
Click Download manifest and save the resulting manifest file to your computer. DO NOT EDIT THE MANIFEST FILE. Doing so will cause the integration to fail.
Finish the integration in Microsoft Teams
Return to the Microsoft Teams site to complete the integration.
In Microsoft Teams, click Apps in the lower-left corner (not Apps in the Developer Portal menu).
Click Upload an app to your org's app catalog.
Locate the app manifest file on your computer and upload it. Once uploaded, the app will appear under the Built for your org heading.
Click on the new app.
Click Add to install the app.
Your Stack Overflow Enterprise app Home screen should appear.
Notifications in private and public teams and channels
It's important to understand that Microsoft Teams will generate notifications from Stack Overflow only to public teams, private teams and public channels. Due to a limitation that affects all bots, the Microsoft Teams integration will not generate notifications to private channels or private chats. If you see a lock icon next to the channel name, Microsoft Teams will not create notifications there.
The same limitations apply to the Microsoft Teams ask and search commands.
Troubleshooting
If an error message appears, or the Microsoft Teams integration doesn't appear to be working properly, the problem is likely one or both of the following.
A firewall rule or network issue is blocking traffic coming into your SOE site.
The app or bot is mis-configured (for example: an incorrect bot endpoint address).
Contact a networking or IT specialist in your organization to make sure your SOE site is accepting traffic from outside your network. If the problem persists, reach out to Stack Overflow support for help.
Upgrade the Microsoft Teams integration
If you have Microsoft Teams integration version 1 and SOE version 2021.3 or later, you can upgrade to Microsoft Teams integration version 2.
In SOE, click on Admin Settings, then click Microsoft Teams under the Integrations and apps heading.
Under the Upgrade to MS Teams v2 heading, click the app manifest for the new version.
Save the app manifest file to your computer.
Follow the steps in the "Finish the integration in Microsoft Teams" section of this article to upload the new manifest file into Microsoft Teams.
Uninstall the Microsoft Teams integration
If you need to uninstall the Microsoft Teams integration, follow these steps.
Go to https://admin.teams.microsoft.com and log in with your admin credentials.
Click on Teams apps, then Manage apps.
Enter "Stack Overflow" into the Search by name box.
In the search results, click on the SOE app.
Click the three dots button (...) in the upper-right corner of the screen.
Click the Actions pull-down and select Delete.
Complete the uninstallation process by deleting Microsoft Teams integration data from your SOE site.
Go to https://[your_site]/enterprise/microsoft-teams/delete.
Click Run /enterprise/microsoft-teams/delete to confirm and start the deletion process.
Microsoft Government Community Cloud
If you're using Microsoft Government Community Cloud (GCC) Regular, you must first follow these steps to enable the addition of the Developer Portal app to your MS Teams environment.
For more information on setup and permission policies with MS Teams, refer to the following Microsoft documents:
The MS Teams integration does not work with Microsoft GCC High or DoD environments.