Azure Bot Service allows to work in an integrated environment which accelerates bot’s development. It enables us to build, connect, deploy and manage bots. Bots interacts naturally like users talking from app or website to Skype, Facebook, Slack, SMS/Text, and other services. Bot can be written in C# or Node.js directly in browser via Azure editor. Azure bot runs in serverless environment by using Azure functions. Bot Service is actually an Azure Web app with additional features. It is also supported by Microsoft Bot Framework. Following are different Bot App templates that can be created:
- Language Understanding
Basic – It is a simple bot which uses normal dialogs to respond to user input.
Form – It is a guided conversation which is used to collect input from user.
Language Understanding – It uses natural language model Language Understanding Intelligent Service (LUIS) for understanding user intent.
Proactive – It uses Azure functions for alert on events to bot users.
Following steps are for creating Azure Bot Service:
Step 1: After signing in to Azure Portal, click on New [+] -> Intelligence + analytics -> Bot Service
Step 2: Fill on App Name, Subscription, Resource group and Location and click “Create”
It will be deployed and will be visible. Under App Services section, we would be able to see our Bot Service with some detailed information.
Step 3: Click on “AzureBasicBotService” (App Name). Now, Microsoft App ID and Microsoft App Password has to be created. Click on “Create Microsoft App ID and Password” to proceed.
Sign in with registered Microsoft credentials to generate App ID and Password.
App ID will be generated as below and click on “Generate an app password to continue” to get one time password.
Step 4: In Azure Portal, paste Id and password. Programming language can be either C# or NodeJS. Here, we C# is selected.
Basic template is selected here to show dimple dialog that will echo back the user’s input. These templates can also be merged and new features can be added. Select “Basic” template and click on “Create Bot”.
Step 5: Now, Bot will be generated.
Step 6: After Bot is generated, new panel will be opened. Under Develop tab, right corner web chat will be opened and left side is the code for application.
On typing any word/letter, bot will echo back it. As we type in, we can see log has been added and events that are getting triggered.
For each line/word that is typed in will be counted and displayed. We can also rest this count by typing in “reset” and we will get a prompt message saying “Are you sure want to reset the code”. Select “Yes”, count will be reset now. From next message it will reset the count as shown below.
Step 7: Bot code can also be customized. After any code change, we can click on save and test it in web chat. Here, I have changed code.
Now, we can test it in web chat.
Step 8: In Channels tab, we would be able to add bot to different channels like Skype, Facebook, Messenger, etc.
In Settings tab, we can change Bot icon and give description for it.
After clicking on “Save” button bot will be updated.
We can also download source code and deploy it from an integrated environment like GitHub, Visual Studio Team Services, etc.
In a similar way, Form Chat Bot can be created. Form Bot is a guided conversation which takes input from users. Below is a sample From Chat Bot that was created.
And again, these question and answers are customizable according to our requirement.