Skip to content

Latest commit

 

History

History
 
 

README.md

echobot

Bot Framework v4 echo bot sample

This bot has been created using Microsoft Bot Framework, it shows how to create a simple bot that accepts input from the user and echoes it back.

Prerequisites

# determine node version
node --version

To try this sample

  • Clone the repository
    git clone https://github.com/microsoft/botbuilder-samples.git
  • In a terminal, navigate to samples/javascript_nodejs/02.a.echobot
    cd samples/javascript_nodejs/02.a.echobot
  • Install modules
    npm install
  • Start the bot
    npm start

Testing the bot using Bot Framework Emulator v4

Microsoft Bot Framework Emulator is a desktop application that allows bot developers to test and debug their bots on localhost or running remotely through a tunnel.

  • Install the Bot Framework Emulator version 4.1.0 or greater from here

Connect to the bot using Bot Framework Emulator v4

  • Launch Bot Framework Emulator
  • File -> Open Bot Configuration
  • Navigate to echobot folder
  • Select echobot.bot file

Deploy the bot to Azure

Prerequisites

In order to deploy your bot to Microsoft Azure, you must have:

  • Azure CLI installed
  • msbot CLI installed
  • An Azure subscription-id
  • An Azure location

Installing the Azure CLI

  • Navigate to the Azure CLI portal.
  • Click the installation instructions for your development environment.

Installing the msbot CLI

You will use msbot CLI to deploy your bot to Microsoft Azure.

npm i -g msbot

msbot requires an Azure subscription-id and an Azure location to deploy. Use Azure CLI to login to Azure, get a list of your subscriptions and get a list of supported locations.

To get a list of valid Azure subscriptions for your account

az login
az account list --output table

To get a list of valid Azure locations

az account list-locations --output table

Deploy using the msbot CLI

To deploy using msbot clone command an Azure subscription-id and Aure location is required.

msbot clone services -n echobot --subscriptionId <Azure-subscription-id> -l <Azure-location> --sdkLanguage "Node" -f deploymentScripts/msbotClone

When msbot runs, it will display a list of resources and services it will provision as part of the bot deployment. It will prompt for confirmation in order to proceed with the deployment. Example output from deploying a bot named ms-chat-bot in westus looks as follows:

Service                             Location   SKU              Resource Group
 Azure App Site Plan                westus     S1               my-chat-bot
 Azure AppInsights Service          West US 2  F0               my-chat-bot
 Azure Blob Storage Service         westus     Standard_LRS     my-chat-bot
 Azure Bot Service Registration     Global                      my-chat-bot
 Azure WebApp Service (Bot)         westus                      my-chat-bot
Would you like to perform this operation? [y/n]

Further reading