Skip to main content

Install and Configure the Microsoft Teams Integration

How to install and configure the Stack Internal Enterprise Microsoft Teams integration.

Joel Bradley avatar
Written by Joel Bradley
Updated over a week ago

Applies to: Enterprise

ADMIN PRIVILEGES REQUIRED

This documentation is for Stack Internal Enterprise. Free, Basic, and Business users can access their documentation here. Find your plan.


NOTE: New Microsoft Teams integrations must now use a single-tenant configuration. This change follows Microsoft's deprecation of multi-tenant bot creation, which went into full effect on July 31, 2025.

Overview

The Stack Internal Enterprise 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 Stack Internal Enterprise site and Microsoft's servers. Information flowing from your site to Microsoft is rarely a problem. Information returning to your site from outside can be blocked by 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 Stack Internal Enterprise 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 INTERNAL ENTERPRISE ONLY.
Other Stack Internal users should read this article instead. Find your plan.

Create an Azure app registration

Setting up the integration requires registering an Azure application and creating an Azure bot to link with your site.

NOTE: You must create the app registration within the same Azure tenant used by your Microsoft Teams instance.

To register your application:

  • Log in to the Microsoft Azure Portal using your Azure subscription account.

  • Search for and select App registrations from the main services menu.

  • Click + New registration to open the registration form.

  • In the Name field, enter "Stack Overflow Enterprise MS Teams" (or similar).

  • Set Support Account Types to Accounts in this organizational directory only ([your directory] only - Single tenant).

  • Redirect URI is optional; you can leave this field blank.

  • Click Register.

  • Go to "Overview". Select and copy your Application (client) ID and Directory (tenant) ID. Paste these to a temp document or note file for later use.

Generate a client secret

After creating the Azure app registration, the portal will direct you to the settings page of your resource. Review that your Application (client) ID and Directory (tenant) ID match your notes, then:

  • Click Add a certificate or secret from the "Client credentials" field on the right.

  • Click + New client secret. A sidebar will appear.

  • Enter a name (e.g., "ms-teams-bot-secret") in the Description field.

  • Choose an expiration period in the Expires field.

NOTE: Expiration period depends on your organization's security policy. You'll need to return to Azure and generate a new secret before this one expires to avoid service interruption.

NOTE: Copy the generated Secret Value immediately and save it to your notes. Azure will not display the secret value 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 one.

Create the Microsoft Teams bot​

Now that you have your app registration credentials, you'll use the Microsoft Azure Portal to create the actual bot resource that connects to Stack Overflow.

  • Click Home or the Microsoft Azure logo in the top-left corner to return to the portal home.

  • Click + Create a resource.

  • Search for "bot" in the search bar, then select the Azure Bot service from the results.

  • Click Create.

  • Select your designated account (e.g., SalesDemoTeamsMSTeamsBot) from the Subscription dropdown menu.

  • Ensure the default Plan remains set to Azure Bot.

  • Click Create and set the Azure Bot configuration fields as follows.

    • Bot handle Enter the Application (client) ID you saved from your earlier app registration.

    • Subscription Select your designated Azure subscription from the dropdown.

    • Resource group Choose your existing resource group (or create a new one) for the bot.

    • Data residency Set this to Global (default) or Regional based on your organization's compliance requirements.

    • Type of App Select Single Tenant.

    • Creation type Select Use existing app registration.

    • App ID Paste your app's Application (client) ID.

    • App tenant ID Paste your Directory (tenant) ID.

Finalize the Bot

  • Click Review + create at the bottom of the screen.

  • Review your configuration values one last time on the summary page.

  • Click Create to deploy your bot.

Configure your bot and connect it with MS Teams​

Now that you've created the bot, you need to connect it to your MS Teams channel and set the endpoint address.

  • Go to the Azure Bot resource you just created.

  • Click Configuration.

  • Set the Messaging endpoint to your site URL plus /integrations/microsoft-teams/messages (for example: https://[your_site].stackenterprise.co/integrations/microsoft-teams/messages).

  • Click Apply to save the configuration.

  • Go to the "Channels" section of the left-hand menu.

  • Click Microsoft Teams under the available channels.

  • Agree to the terms of service.

  • Select Microsoft Teams Commercial (most common).

  • Click Apply to save the channel.

Configure Stack Internal Enterprise

With your new bot ID and client secret ready, switch to your Stack Internal Enterprise site to link the two systems. Ensure you're logged in with admin rights.

  • In the left-hand menu, click Admin settings.

  • Under the "Integrations and apps" heading, click Microsoft Teams.

  • Paste your application (client) ID into the Bot app ID field.

  • Paste your secret value into the Bot app password field.

  • Click Save credentials.

  • Click Download manifest and save the file to your computer.

NOTE: DO NOT edit the manifest file. Doing so will break the integration.

Update Service OAuth URL

Because this is a single-tenant bot, you must manually update the OAuth URL so Stack Overflow knows to authenticate against your specific tenant rather than the global bot service.

Finish the integration in Microsoft Teams

To finish the integration, you'll upload your manifest to the MS Teams environment to make the bot available to your users.

  • Open Microsoft Teams and click Apps in the lower-left corner.

  • Select Manage your apps, then Upload an app, then Upload a custom app.

  • Locate the app manifest file on your computer and upload it.

  • Click Add to install the app. You should get a popup window showing “Added successfully”.

  • Click Open for the Stack Internal home interface, or choose an existing MS Teams conversation to install the app.

  • From the Stack Overflow Internal "Home" tab, click Log in to Stack Overflow to authenticate with your internal site instance.

  • Click Log in on the Stack Overflow Internal redirect page and log into your site.

  • Click Authorize on the MS Teams integration permission request box.

You've now integrated your site with an MS Teams single-tenant bot. To learn more about using the MS Teams integration, read the Microsoft Teams Integration user guide.

Did this answer your question?