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.
- Node.js version 8.5 or higher
# determine node version
node --version- Clone the repository
git clone https://github.com/microsoft/botbuilder-samples.git
- In a terminal, navigate to
samples/javascript_nodejs/02.a.echobotcd samples/javascript_nodejs/02.a.echobot - Install modules
npm install
- Start the bot
npm start
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
- Launch Bot Framework Emulator
- File -> Open Bot Configuration
- Navigate to
echobotfolder - Select
echobot.botfile
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
- Navigate to the Azure CLI portal.
- Click the installation instructions for your development environment.
You will use msbot CLI to deploy your bot to Microsoft Azure.
npm i -g msbotmsbot 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.
az login
az account list --output tableaz account list-locations --output tableTo 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/msbotCloneWhen 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]