Welcome to a hands-on workshop for Building a Web App Bot in 10 Minutes using Azure Portal, QnA Maker, the Bot service, and Microsoft Teams
To deploy the Azure resources required for this lab, you will need:
-
Note:
If you don't have an account you can create your free Azure account here -
Clone this GitHub repository using Git and the following commands:
git clone https://github.com/DataSnowman/BotInTen.git
Create an Azure QnA Maker Cognitive Service in the Resource group created earlier using the Azure Portal
- Search for
QnA
in the Azure Portal
- Click
Create
-
Sign in to the QnA Maker portal.
-
Select
Create a knowledge base
from the top menu. -
Skip Step 1 becasue we already created a QnA service, but complete steps 2-5.
In step 4 enter a URL of your choice to an online FAQ like this on on Slavic Languages
-
Click
Create your KB
- To test the Knowledge base click the
Test
button and enter a question that was imported by the FAQ to that you entered manually and Saved and Trained
- Click
Publish
to publish the Knowledge base
For more details check out Tutorial: Create a knowledge base then answer question via the QnA Maker portal
- Search for
Bot
in the Azure Portal and selectWeb App Bot
- Click
Create
For more details check out Tutorial: Create a QnA Bot with Azure Bot Service v3
- In the Azure Portal open the
Web App Bot
and selectTest in Web Chat
For more details on how to do this Get the App Setting from QnA Maker.
-
Open Application Settings and edit the QnAKnowledgebaseId, QnAAuthKey, and the QnAEndpointHostName fields to contain the values of your QnA Maker knowledge base.
-
Click
Save
-
Get your knowledge base ID, host url, and the endpoint key from the settings tab of your knowledge base in the QnA Maker portal.
- Sign in to QnA Maker
- Go to
My knowledge bases
and select your Knowledge base name - Select the Settings tab
- Publish your knowledge base, if not already done so
Note: Be careful to put the
QnAAuthKey
(which is the last key in the deployment details) and theQnAKnowledgebaseId
(which is the first ID in the deployment details) in the correct place in the Application settings. If your bot is not working inTest in Web Chat
it could be because you have these in the wrong place.
In the Azure portal, select Test in Web Chat to test the bot.
Type in something like What languages are related to Russian?
The first time it might be a bit slow. If it does not return an answer double check your values in Application Settings
per the Note above.
Your QnA Bot answers from your knowledge base.
- Click on Channels and click Teams. Click
Save
andAgree
to Terms of Service
- Click on the
Microsoft Teams
Channel andOpen Microsoft Teams
- Ask the bot a question in teams like
What are the Slavic languages?
- Click on Store > Bots > App Studio
- Click on
Available
- Click on
Open
next toBot
- Click on
Manifest editor
and selectCreate a new app
- Enter details into the Manifest. Click
Generate
to generate an App ID
- Click on Bots under the Capabilities section on the left navigation and click
Set up
- Choose
Existing bot
and provide a name for the bot, for the Bot ID chooseSelect from one of my existing bots
and select the correct bot, and select the Scope in Teams and clickCreate bot
- Click on
Test and distribute
and then click onInstall
- Choose the team you want the bot to be part of in
Add to a team
and selectInstall
- Pick the channel where you want to use the app and click
Setup
- Click on the bot link, type a question, and click on the Conversation bubble icon
- It works
If you would like to see a video on this check out Larry Jin and Mark Rackley's Ignite Theatre Session from Microsoft Ingite THR2040 - Build a bot in five minutes