A Message Extension allows users to interact with your web service while composing messages in the Microsoft Teams client. Users can search or initiate actions in an external system from compose message area, the command box, or directly from a message.
This app template implements action command that allows you to present your users with a modal pop-up called a task module in Teams. The task module collects or displays information, processes the interaction, and sends the information back to Teams.
Prerequisites
To run the template in your local dev machine, you will need:
- Node.js, supported versions: 16, 18
- A Microsoft 365 account for development
- Teams Toolkit Visual Studio Code Extension version 5.0.0 and higher or Teams Toolkit CLI
- First, select the Teams Toolkit icon on the left in the VS Code toolbar.
- In the Account section, sign in with your Microsoft 365 account if you haven't already.
- Press F5 to start debugging which launches your app in Teams using a web browser. Select
Debug (Edge)
orDebug (Chrome)
. - When Teams launches in the browser, select the Add button in the dialog to install your app to Teams.
- To trigger the action command, you can click the
...
under compose message area, click...
->More actions
beside a message, or @ your message extension app from the command box.
Congratulations! You are running an application that can share information in rich format by creating an Adaptive Card in Teams.
Folder | Contents |
---|---|
.vscode/ |
VSCode files for debugging |
appPackage/ |
Templates for the Teams application manifest |
env/ |
Environment files |
infra/ |
Templates for provisioning Azure resources |
src/ |
The source code for the action application |
The following files can be customized and demonstrate an example implementation to get you started.
File | Contents |
---|---|
src/actionApp.ts |
Handles the business logic for this app template to collect form input and process data. |
src/index.ts |
index.ts is used to setup and configure the Message Extension. |
The following are Teams Toolkit specific project files. You can visit a complete guide on Github to understand how Teams Toolkit works.
File | Contents |
---|---|
teamsapp.yml |
This is the main Teams Toolkit project file. The project file defines two primary things: Properties and configuration Stage definitions. |
teamsapp.local.yml |
This overrides teamsapp.yml with actions that enable local execution and debugging. |
Following documentation will help you to extend the template.
- Add or manage the environment
- Create multi-capability app
- Add single sign on to your app
- Access data in Microsoft Graph
- Use an existing Azure Active Directory application
- Customize the Teams app manifest
- Host your app in Azure by provision cloud resources and deploy the code to cloud
- Collaborate on app development
- Set up the CI/CD pipeline
- Publish the app to your organization or the Microsoft Teams app store
- Develop with Teams Toolkit CLI
- Preview the app on mobile clients