Edit

Share via


Extend a Teams message extension across Microsoft 365

Message extensions allow users to interact with your web service using buttons and forms. Users can search or initiate actions in an external system from Microsoft Teams and Outlook by extending your Teams apps across Microsoft 365. There are two types of message extensions:

  • Search-based message extensions: Users can search an external system and share results through the compose message area of the client.

  • Action-based message extensions: Users can use a modal pop-up to collect or display information, process the interaction, and send the information back to the client as a rich card.

Note

Teams search-based message extensions are generally available for Outlook, and action-based message extensions are available in preview for Outlook.

Outlook mobile users on Android and iOS can receive and act on cards sent from Outlook on the web or Outlook for Windows.

Teams message extension across Microsoft 365 also supports link unfurling that display cards to launch Stageview and dialogs.

Channel requirements for Copilot plugins

Copilot plugins that use a bot must have the Microsoft 365 channel enabled in Azure portal (Bot Channels Registration). If this channel is missing, disabled, or misconfigured, Microsoft 365 Copilot can’t route requests to your bot. This issue can result in HTTP 500 errors, missing responses, or other runtime failures.

Important

Message extensions in Outlook require the Microsoft 365 channel. If you enabled the Outlook channel previously, enable the Microsoft 365 channel instead and disable the Outlook channel.

If you see an HTTP 500 error, the following checks may help you troubleshoot the issue before reaching out to Azure support:

  • Go to the Azure portal > Bot Channels Registration > Channels and verify that the Microsoft 365 channel is enabled.
  • Confirm that Teams channel is enabled and not in an error state.
  • Verify that the Message Endpoint is correct and up-to-date in Bot Channels Registration > Settings.
  • Ensure that your plugin or Teams app manifest uses manifestVersion 1.16 or later and includes runtime configuration with Microsoft 365 as a supported host.
  • Test the bot outside of Copilot by calling the bot API directly or by using the Agents Playground. If the bot fails outside Copilot, the issue is likely in the bot code or backend service.

For more information, see Add Microsoft 365 channel for your app.

Prerequisites

To extend your Teams message extension to Outlook, ensure the following prerequisites are met:

Build or extend a message extension

To extend your Teams message extension to Outlook, you can either build a new message extension app with Microsoft 365 Agents Toolkit (previously known as Teams Toolkit) or extend an existing Teams message extension app to Outlook.

You can build a Teams message extension app for Outlook through Agents Toolkit extension for Visual Studio Code. To build a message extension app for Outlook, ensure the following:

You can build either a search-based or an action-based message extension.

  1. Open Visual Studio Code.

  2. Select Command Palette... under the View option or Ctrl+Shift+P.

  3. Select Microsoft 365 Agents: Create New Agent/App.

  4. Select Teams Agents and Apps.

  5. Select Other Teams Capabilities.

  6. Select Message Extension from the dropdown list.

  7. Select Custom Search Results to download the sample code for a Teams search-based message extension using the latest app manifest (previously called Teams app manifest).

    Screenshot shows the Create a new Teams app VS Code command palette to list Teams sample options.

    You can also download the sample code from the left pane, under DEVELOPMENT, select View Samples. A Samples tab appears, in the search field enter NPM Search Connector.

    Screenshot shows the NPM Search Connector sample in Microsoft 365 Agents Toolkit Samples gallery.

  8. Select a preferred programming language.

  9. Select a location on your local machine for the workspace folder and enter your application name.

  10. Select Command Palette... under the View option or Ctrl+Shift+P.

  11. Enter Teams: Provision to create the relevant app resources, such as Azure App Service, App Service plan, Azure Bot, and Managed Identity, in your Azure account.

  12. Select a subscription and a resource group.

  13. Select Provision. Alternatively, you can select Provision under the LIFECYCLE section of the extension.

  14. Select Command Palette... under the View option or Ctrl+Shift+P.

  15. Enter Teams: Deploy to deploy the sample code to the provisioned resources in Azure and start the app. Alternatively, you can select Deploy under LIFECYCLE section of the extension.

  16. Select Deploy.

Now, you can upload your app in Teams and preview your message extension in Outlook. To build your app package through Agents Toolkit, see build app package.

Upload your custom app in Teams

Upload your updated message extension as an app package into Teams. After you finish, the message extension appears in your installed Apps from the compose message area.

  1. Create a .zip file with app manifest and app icons.

  2. Go to Teams and sign in by using your sandbox tenant account.

  3. Select Apps > Manage your apps > Upload an app.

    Screenshot shows the Upload an app option under Manage your apps.

  4. Select the Upload a custom app option, select your .zip file, and install (Add) it to your Teams client.

    Screenshot shows the Upload a custom app option in Teams.

After you upload the app through Teams, your message extension is available in Outlook for Windows desktop and web.

Preview your message extension in Outlook

Here's how to test your message extension running in Outlook on the web. To preview your app running in Outlook on the web, follow these steps:

  1. Sign in to outlook.com by using your test tenant credentials.

  2. Select New message.

  3. Select Apps on the ribbon.

    Screenshot shows the preview your message extension in Outlook on the web.

Your message extension is listed. You can invoke it from there and use it just as you would while composing a message in Teams.

Debugging

As you debug your message extension, you can identify the source (originating from Teams versus Outlook) of bot requests by the channelId field of the Activity object. When a user performs a query, your service receives a standard Bot Framework Activity object. One of the properties in the Activity object is channelId, which has the value of msteams or m365extensions, depending on where the bot request originates. For more information, see search based message extensions SDK and action based messaging extensions SDK.

Limitations

While your updated message extension continues to run in Teams, be aware of the following limitations:

  • Message extensions in Outlook are supported only in the compose context. In Teams app manifest, message extension contexts such as commandBox and message aren't supported in Outlook.

  • Outlook supports action-based message extensions that send cards into the compose box. However, using bots to deliver cards isn't supported. In this scenario, you can convert your message extension to send cards into the compose box in Outlook.

  • You can't insert more than five Adaptive Cards in an email.

  • Card actions of type messageBack, imBack, invoke, and signin aren't supported. openURL is the only supported card action.

  • Adaptive Card actions are supported. For Action.Submit only stageview and taskmodule launching is supported.

Note

When you test an app with link unfurling, ensure that you remove the app manually after testing. If multiple apps are monitoring the same domain, the app installed most recently might not be invoked to unfurl the link in Outlook, as it would be in Teams.

Use the Teams developer community channels to report issues and provide feedback.

Code sample

Sample Name Description Node.js
NPM Search Connector Teams Toolkit sample app to build a message extension app. Works in Teams and Outlook. View
Teams Link Unfurling This sample app showcases a Node.js bot that implements link unfurling within Teams messaging extensions. View
Tab in Stageview This sample app demonstrates the use of Teams tab in stage view using Node.js, featuring collaborative elements and interactive capabilities. View
Teams action-based message extension for Microsoft 365 Teams Toolkit sample app to build a message extension app. Works in Teams and Outlook. View

Next step