Building Bots with The Microsoft Bot Framework - Part 5
Welcome to the final post in my series of blogs on Building Bots with The Microsoft Bot Framework. Till now we were building our bot and adding features to it. In this article, we will be publishing our bot and later chat with our bot on Skype.
Deploy Your Bot
The bot that we have built till now is a small web application that communicates with the client using the REST protocol. From Visual Studio, right click on the BlogBot project and select Publish. Follow the wizard to publish your bot application to an Azure WebApp. You can follow the steps mentioned here to help you with the process.
Register Your Bot
We now need to register our bot so that users can interact with it. Now, browse to the bot developer portal and sign in with your Microsoft account. To create a new bot, click on the My Bots option and then on the Create button.
In the prompt that follows, select the “Register an existing bot built using Bot Builder SDK” option. Now, you will be presented a form to fill up your bot profile. Enter a display name (the name you will see in your chats with the bot), a unique bot handle, and a description that users can see to know more about your bot.
In the Configuration section, enter the channel endpoint of your bot, that is the host URL including the “/api/messages” part. Next, click the Create Microsoft App ID and Password button, which will take you to the page where you can create credentials that the clients can use to communicate with your bot. Obtain Application Id and Password from the wizard and paste them in the
appSettings section of the web.config file of your bot.
<add key="MicrosoftAppId" value="Your Application Id" /> <add key="MicrosoftAppPassword" value="Your Application Password" />
At this point, you would need to redeploy your bot so that credentials take effect immediately. Finally, in the bot developer website, click on the Register button to complete the registration process.
Your newly provisioned bot will be available under My bots section of the portal. Clicking on your bot name from the list will take you to your bot’s dashboard. Here, you can see that two channels, Skype, and web chat, have been automatically provisioned for you.
Testing Your Bot on The Skype Channel
Click on the Skype channel on the channels tab to launch your bot on Skype channel.
You can now talk to your bot on Skype. Let’s try to carry out the
BlogComment conversation with the bot.
When you are ready to deploy the bot for broader consumption, you can submit it for review to Microsoft by clicking on the Publish option inside the channel.
What About Other Channels?
Channels differ from each other concerning features that they provide. For example, the Facebook messenger channel supports cards and carousels to display content. You can use
ChannelData property, which is a dynamic list of properties and data specific to a channel or key-value pairs, to utilize the capabilities of an individual channel. You can read more about
ChannelData and how to use it to implement channel-specific functionality here.
Hope you had fun going through the various articles and building bots along with me. I would like to thank Luiz Bon, my friend and colleague from Readify, who guided me with his expertise and took the time to go through all the articles in this series.
My friend and colleague from Microsoft, Ankit Vijay, built a similar tutorial series on the bot framework which uses an alternate approach to building bots using the QnA Maker Service. You can find his blogs here.
Your 2 cents
GET SMARTER!Stay up to date with interesting posts like these. Take a moment to subscribe!
- Integration Tests in Azure Pipelines with ASP.Net Core and SQL on Docker
- Appropriately Release Resources From DotNet Core Application Deployed in Kubernetes Cluster
- Count Online Users with Azure SignalR Service
- Add DevOps To Your Existing Dockerized Applications With Azure DevOps Projects
- Delivering IoT Mixed Reality Applications using The MSF Process Model (Develop, Stabilize, and Deploy) – Part 3