Bots and Microsoft Teams
Posted on March 01, 2018 by Richard Brynteson in Microsoft Teams Development
So I’ve been tasked with creating some fun bots for work. So when I jumped into the Azure Portal and created my first bot I noticed a lot of different “sample” projects that were not there before. One in particular jumped out to me, the QnAMaker. So I decided to spend a bunch of time before our last Users Group meeting and create one.
[NOTE: Since I’ve been writing this blog post over the last week a real developer – Tom Morgan has posted on the same subject – so go read his blog about this because honestly he is 1000% better at this than me. Did I mention, he is a developer!]
[NOTE AGAIN: Seriously, why are you still reading this post? Tom’s has a video even and is a developer. Only continue to read if you don’t know what you are doing and want to laugh.]
So let’s create our bot.
Step One: Go login to the Azure Portal. Sign up if you don’t have an account. Bots are super cheap to run so you can do this nearly free I think.
Step Two: Click on Add Resource, click AI + Cognitive Services and choose Web App Bot
Step Three: Enter the details of your bot. A few things I learned while I was doing this. When you are done, click Create. It will take a few minutes.
- Make sure to select the Question and Answer from the Bot Template
- Create a new storage location. I tried several times selecting an existing storage group and it failed every time.
- Make sure you write down that App ID and Password you create at the bottom. Not sure if or when you might need that password again but it is very clear that you never get to see it again.
Step Four: Create your QnA from Microsoft’s QnA Service. Head over to https://qnamaker.ai/ and login. When you are there, click on New Service and fill in the form.
Step Five: Add some questions and answers. There is an option to crawl your website in the above step. I tried SO MANY different pages and none of them worked. So I’m not sure what format they are looking for but I don’t have it.
Step Six: Click publish at the top of the page. You will see a page like the below. It will contain your Subscription Key and Knowledgebase ID.
Step Seven: Go back to the Azure Portal and your bot should be done now. Go to Application Settings and enter in the Subscription Key and Knowledgebase ID. You will need to scroll way down.
Step Eight: Your bot should work now. So you can head over to Test in Web Chat and it should work. So lets make it available in Microsoft Teams now.
Step Nine: In the Azure Portal, click on Channels under your bot.
Then accept the license agreement.
Step Ten: Lets go chat with our new bot in Microsoft Teams. Remember that App ID that I told you to write down in Step Three? Go start a new chat in Teams with that App ID.
What’s next? Let’s make it so your bot says hello back to you when you start a chat with it. That will be the next step in our fancy new bot. Then we will figure out how to distribute it to your business.