Skip to content

Latest commit

 

History

History

bot

How to use this Teams Bots HelloWorld app

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 bot application demonstrating how to create commands and build adaptive cards that best for automation and notification scenario using botbuilder and adaptivecards-templating.

If you are looking for a sample that implements Single Sign On, please refer here.

Prerequisites

Debug

  • From Visual Studio Code: 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 Run and Debug green arrow button.
  • From TeamsFx CLI: Start debugging the project by executing the command teamsfx preview --local in your project directory.

Edit the manifest

You can find the Teams manifest in templates/appPackage/manifest.template.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 to Azure

Deploy your project to Azure by following these steps:

From Visual Studio Code From TeamsFx CLI
  • Open Teams Toolkit, and sign into Azure by clicking the Sign in to Azure under the ACCOUNTS section from sidebar.
  • After you signed in, select a subscription under your account.
  • Open the Teams Toolkit and click Provision in the cloud from DEVELOPMENT section or open the command palette and select: Teams: Provision in the cloud.
  • Open the Teams Toolkit and click Deploy to the cloud or open the command palette and select: Teams: Deploy to the cloud.
  • Run command teamsfx account login azure.
  • Run command teamsfx account set --subscription <your-subscription-id>.
  • Run command teamsfx provision.
  • Run command: teamsfx deploy.

Note: Provisioning and deployment may incur charges to your Azure Subscription.

Preview

Once the provisioning and deployment steps are finished, you can preview your app:

  • From Visual Studio Code

    1. Open the Run and Debug Activity Panel.
    2. Select Launch Remote (Edge) or Launch Remote (Chrome) from the launch configuration drop-down.
    3. Press the Play (green arrow) button to launch your app - now running remotely from Azure.
  • From TeamsFx CLI: execute teamsfx preview --remote in your project directory to launch your application.

Validate manifest file

To check that your manifest file is valid:

  • From Visual Studio Code: open the Teams Toolkit and click Validate manifest file or open the command palette and select: Teams: Validate manifest file.
  • From TeamsFx CLI: run command teamsfx validate in your project directory.

Build

  • From Visual Studio Code: open the Teams Toolkit and click Zip Teams metadata package or open the command palette and select Teams: Zip Teams metadata package.
  • Alternatively, from the command line run teamsfx build in the project directory.

Publish to Teams

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 Teams Toolkit and click Publish to Teams or open the command palette and select: Teams: Publish to Teams.
  • From TeamsFx CLI: run command teamsfx publish in your project directory.

Further reading