In May 2017 I did a talk in Ottawa .NET User Group on Introduction to Microsoft Bot Framework, it was a interesting turnout and lots of conversation on what a bot can do for a business and how to use them.

Below you will find the slides for my talk on Microsoft Bot Framework. The sample demo code can be find on github, where we demo searching of Real Estate, image search, etc.

Ottawa IT Meetup Community:

If you are interested in more on bot framework and like to see more articles on it, please let me know 🙂


1. Introduction to Bot Framework Taswar Bhatti @taswarbhatti
2. What is a Bot? • In this context Microsoft Bot Framework, bots are computer assistants or think of it as just a web api (ASP.NET Web App) • Bots appear in your favorite messaging app including Facebook Messenger and Skype • You use bots for booking flights, hotels, ordering takeaway and much, much more • Purchase Request Api to build commerce enabled bot
3. Not, not this Bot!
4. Bot Framework Overview • The Microsoft Bot Framework consists of: • Bot Builder SDK(.NET, Node.js, REST Api) • Bot Framework Emulator for Windows, Linux and Mac • Bot Connector • Developer Portal ( • Bot Directory
5. High Level view of Bots
6. Bot Connector
7. Deep Vision of Bot
8. An Echo Bot Code • [BotAuthentication] • public class MessagesController : ApiController{ • public async Task Post([FromBody]Activity activity) { • if (activity.Type == ActivityTypes.Message) { • ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl)); • // return our reply to the user • Activity reply = activity.CreateReply($”Echo {activity.Text}”); • await connector.Conversations.ReplyToActivityAsync(reply); • } else { • HandleSystemMessage(activity); • } • var response = Request.CreateResponse(HttpStatusCode.OK); • return response; • } • }
9. Bot Emulator • The Bot Famework Emulator is a desktop application that allows bot developers to test and debug their bots on localhost • It is supported on Windows, Linux and Mac
10. Bot Emulator Screenshot
11. Demo Bot Framework
12. Bot Builder Dialog and Sessions • Bot builder uses dialogs to manage a bot conversation between a user • Session Objects are passed to the dialog handlers • Session Objects are the primary mechnics between bots and users
13. Types of Dialogs • Prompts – Text, Confirm, Number, Time, Choice, etc • Waterfall dialogs – collection and use sequence of steps • User Data – Store data of user, conversation (private data) Payload max is 32k • Intent Dialog – listen to keywords or phrases using NLP (e.g LUIS) • Attachments and Cards – For Rich Objects (media or images)
14. Demo Search Image and Card • Using cognitive vision api
15. Guideline for bots • Don’t send a bot to do a webpages’s job • Bots are just apps • Don’t abuse Natural Language Processing • Sometimes buttons do everything you need • Its all a matter of User Experience
16. Resources • Microsoft Bot Framework Resources ( • LUIS ( • Azure Trail ( • Books (Building Bots with Microsoft Bot Framework PACKT) • Books (Programming the Microsoft Bot Framework MSPress) • An introduction to Microsoft Bot Framework
17. Questions • Questions?????