This sample demonstrates how the Recognizers can be used with a BotBuilder Bot to parse user input. The bot provides a basic experience for ordering roses, it starts by asking the amount of roses and then asks for a delivery date and time. This bot has been created using Bot Framework, it shows how to:
- Implement a multi-turn conversation using Dialogs
- Prompt for and validate requests for information from the user
This sample requires prerequisites in order to run.
-
In a terminal, navigate to
<your_project_folder>/BotBuilder# change into project folder cd <your_project_folder>/BotBuilder
-
Run the bot from a terminal or from Visual Studio, choose option A or B.
A) From a terminal
# run the bot dotnet runB) Or from Visual Studio
- Launch Visual Studio
- File -> Open -> Project/Solution
- Navigate to
<your_project_folder>/BotBuilderfolder - Select
BotBuilderRecognizerBot.csprojfile - Press
F5to run the project
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.2.0 or greater from here
- Launch Bot Framework Emulator
- File -> Open Bot Configuration
- Navigate to
<your_project_folder>/BotBuilderfolder - Select
BotBuilderRecognizerBot.botfile
After creating the bot and testing it locally, you can deploy it to Azure to make it accessible from anywhere. To deploy your bot to Azure:
# login to Azure
az login# set you Azure subscription
az account set --subscription "<azure-subscription>"# provision Azure Bot Services resources to host your bot
msbot clone services --name "BotBuilder" --code-dir "." --location westus --sdkLanguage "Csharp" --folder deploymentScripts/msbotClone --verboseAs you make changes to your bot running locally, and want to deploy those change to Azure Bot Service, you can publish those change using either publish.cmd if you are on Windows or ./publish if you are on a non-Windows platform. The following is an example of publishing
# run the publish helper (non-Windows) to update Azure Bot Service. Use publish.cmd if running on Windows
./publishTo learn more about deploying a bot to Azure, see Deploy your bot to Azure for a complete list of deployment instructions.