A bot, chatbot, or conversational bot is an app that responds to simple commands sent in chat and replies in meaningful ways. Examples of bots in everyday use include: bots that notify about build failures, bots that provide information about the weather or bus schedules, or 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.
This is a sample chatbot application demonstrating Single Sign-on using botbuilder and Teams Framework that can respond to a hello message.
- NodeJS
- An M365 account. If you do not have M365 account, apply one from M365 developer program
- Teams Toolkit Visual Studio Code Extension or TeamsFx CLI
- From Visual Studio Code, open command palette and select
Teams: Create New Project. Or from the CLI, (afternpm install -g @microsoft/teamsfx-cli) run commandteamsfx new. - Choose the bot capabilities from the prompts.
Note: You have the option to reuse an existing bot by entering the credential manually. But make sure that bot is not associated with any AAD apps.
Start debugging the project by hitting the F5 key in Visual Studio Code. Alternatively use the Run and Debug Activity Panel in Visual Studio Code and click the Start Debugging green arrow button.
You can find the Teams manifest in .fx/manifest.source.json. It contains template arguments with {...} statements which will be replaced at build time. You may add any extra properties or permissions you require to this file. See the schema reference for more.
Deploy your project to Azure by following these steps:
| From Visual Studio Code | Using TeamsFx CLI |
|---|---|
|
|
Note: Provisioning and deployment may incur charges to your Azure Subscription.
Once the provisioning and deployment steps are finished, you can preview your app:
- From Visual Studio Code, open the
Run and Debug Activity Panel. - Select
Launch Remote (Edge)orLaunch Remote (Chrome)from the launch configuration drop-down. - Press the Play (green arrow) button to launch your app - now running remotely from Azure.
To check that your manifest file is valid:
- From Visual Studio Code: open the command palette and select:
Teams: Validate App Manifest File. - From TeamsFx CLI: run command
teamsfx validatein your project directory.
- From Visual Studio Code: open the command palette and select
Teams: Build Teams Package. - Alternatively, from the command line run
teamsfx buildin the project directory.
Once deployed, you may want to distribute your application to your organization's internal app store in Teams. Your app will be submitted for admin approval.
- From Visual Studio Code: open the command palette and select:
Teams: Publish to Teams. - From TeamsFx CLI: run command
teamsfx publishin your project directory.