Examples of Microsoft Teams bots in everyday use include:
- Bots that notify about build failures.
- Bots that provide information about the weather or bus schedules.
- Bots that provide travel information.
A bot interaction can be a quick question and answer, or it can be a complex conversation. Being a cloud application, a bot can provide valuable and secure access to cloud services and corporate resources.
Prerequisites
To run the Basic Bot 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.
- You will receive a welcome message from the bot, or start typing
welcome
orlearn
to get a response.
Congratulations! You are running an application that can now interact with users 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 |
The following files can be customized and demonstrate an example implementation to get you started.
File | Contents |
---|---|
adaptiveCards/learn.json |
Defines the adaptive card returned from bot when learn command is triggered. |
adaptiveCards/welcome.json |
Defines the adaptive card returned from bot for welcome message and welcome command. |
teamsBot.js |
Handles business logics for the Basic Bot. |
index.js |
index.js is used to setup and configure the Basic Bot. |
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 Basic Bot 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