How-To guides

Create AI Chatbot using Microsoft Bot Framework (Part 2)

In the last post, we have built a Q&A service using  Microsoft QnA Maker & have published it. In this post, we will look at how to build a bot that uses the QnA service. Just to recap, Azure Bot Service which provides an integrated environment that is purpose-built for bot development, enabling us to build, connect, test, deploy, and manage bots, all from one place. It is powered by Microsoft Bot Framework and Azure Functions, which means that the bot will run in a serverless environment on Azure that will scale based upon demand.

Following is an outline of this post :

  1. Create Azure service bot.
  2. Enable Web chat channel on the bot.
  3. Embed the webchat on the website.

Pre-requisites:

  1. Microsoft Account for generating AppID for your bot.
  2. Microsoft Azure subscription to use Azure Bot service.

Now we will head over to the Azure management portal, once you log in under Data + Analytics category, and select Bot Service.

  1. In the Bot Service blade, provide the required information, and click Create to create the bot service and deploy it to the cloud.
    • Set App name to required bot’s name. The name is used as the subdomain when the bot is deployed to the cloud (for example, demoqnamaker.azurewebsites.net).
    • Select the subscription to use.
    • Select the resource group and location. Either you can create new or use existing.

      Set App name, Subscription to use, resource group, and location.

  2. On the next page, create an app ID and password for your bot, so that it will be able to authenticate with the Bot Framework.
    • On click of ‘Create Microsoft App ID and Password’, click Generate an app password to continue.
    • Copy and store the password that is shown, and then click Ok.
    • Click Finish and go back to Bot Framework.
    • Back in the Azure Portal, the app ID field is now auto-populated for you. Paste the password that you copied (in the step above) into the password field.
      Click ‘Create Microsoft App ID and password to continue
      App ID generated.
      Note down the password so that we can use it in the next step.

      Both App ID and Password generated, click ‘Finish and go back to Bot Framework’ to go back to Azure portal

  3. Choose the programming language to develop the bot, here I have opted for C#. Also, there is an option to choose the Bot template, make sure to select it as ‘Question and Answer’
    • Now we have to select the service which we have created in the last post, here it’s ‘Demo’ and then click Ok.
      Select Language & make sure to select the template as ‘Question and Answer’

      Choose the QnA service we created earlier

  4. When the bot service finishes generating the bot, the Azure editor will contain the bot’s source files. At this point, the bot has been created, registered with the Bot Framework, deployed to the cloud, and is fully functional.

    Congratulations! You’ve successfully created a bot!

  5. Now that the bot is up and running in the cloud, we can try it out by typing a few messages into the built-in chat control that’s located to the right of the code editor in the portal. The bot responds to each message by echoing back your message prefixed with the text You and response by the name of your bot.
    Now the bot is ready, we can try out some questions to check the response

    Now the bot is ready, we can try out some questions to check the response

  6. The next step is to enable the webchat channel, this can be done by clicking on the ‘Channels’ tab on the top bar. Once you’re in channel settings, you can customize the look and feel of the button and you can get embed code at the bottom left portion of the page.
    Enable Webchat channel

    Webchat channel customization, copy embed code to use it in page/website.

  7. Once you have the embed code, the same can be embedded to the page/website you wish.
    Congratulations! Your 1st Bot is ready.

    Now that you’ve created your first bot, there is more to explore. Just recap of what we have done

    1. Create Q&A knowledge base.
    2. Create Azure service bot.
    3. Enable Web chat channel on the bot.
    4. Embed the webchat on the website.

If you want to explore more, please check the links below.

I hope you have enjoyed learning along with me. If you have questions, please share them in the comments section.

Like this post? Don’t forget to share it!

Summary
Article Name
Create AI Chatbot using Microsoft Bot Framework (Part 2)
Description
In this post,we will look at how to build a bot that uses the QnA service.
Author
Publisher Name
upnxtblog
Publisher Logo
Karthik

Allo! My name is Karthik,experienced IT professional.Upnxtblog covers key technology trends that impacts technology industry.This includes Cloud computing,Blockchain,Machine learning & AI,Best mobile apps, Best tools/open source libs etc.,I hope you would love it and you can be sure that each post is fantastic and will be worth your time.

Share
Published by
Karthik

Recent Posts

Finding the Right Time to Build Your Software Instead of Buy

There are few things as valuable to a business as well-designed software. Organizations today rely…

5 days ago

Innovators in Crypto: Prominent AI-Powered Coins

The cryptocurrency industry is being reshaped by the fusion of blockchain technology and artificial intelligence…

3 weeks ago

Top AI Design Tools Every Graphic Designer Should Use in 2024

Introduction Artificial Intelligence (AI) has also found its relevance in graphic design and is quickly…

2 months ago

Transforming Industries: The Integration of AI and Blockchain

Imagine a world where the brilliance of Artificial Intelligence (AI) meets the unbreakable security of…

2 months ago

How Can I Use Automation to Streamline My Digital Marketing Efforts?

In today’s fast-paced digital landscape, automation is not just a luxury but a necessity for…

2 months ago

Top 5 AI Technologies Transforming the Casino Gaming Landscape in 2025

The world of casino gaming has leveraged the emerging technology advancements to create immersive and…

3 months ago

This website uses cookies.