QnA Maker SDK/Azure templates active learning and endpoint URL - azure

Once the bot is created using qnamaker.ai, I wanted to deploy it in Azure using the SDK and publishing from VS2017, which let me define the top parameter to enable the Active Learning as shown in https://github.com/Microsoft/BotBuilder-CognitiveServices/tree/master/CSharp/Samples/QnAMaker
But when I want to register it in dev.botframework the end point URL doesn't work.
If I use Azure Bot Service template, is not possible to set the top parameter but registering in my Bots is ready straight forward.
I have realized that the URL from Azure template contains some extra info, that is not available in my web app
...code=2xDGuyPbupZIm8zsDOucgcHDvXO908dPIad2LFG2y/37TPecdMfQEw==
A "typical" URL from Azure, that work with other deployed Bots is https://"MyBotName".azurewebsites.net/api/messages
Please, can you help enabling the active learning in Azure templates for a Q&A bot?
Can you explain me what should I add to get the "extra details" in my Web app URL?

I think there is some misunderstanding here. The QnA Maker site is not creating any bot for you. It just provisions the QnA service (a rest API).
If you want to have a bot on top of the service you created, grab the code of the QnABotWithActiveLearning sample that you linked, update the QnADialogWithActiveLearning.cs class to include your QnA subscription key (that you can get from the Settings tab of your QnA service), update MicrosotAppId and MicrosoftAppPassword settings on the Web.config with the ones you got from the BotFramework developer portal and deploy to Azure as a Web App.
Once done, you will have the standard websites URL https://"MyBotName".azurewebsites.net and the API endpoint https://"MyBotName".azurewebsites.net/api/messages.
Then just update your bot URL in the BotFramework portal with this URL.

Related

Is Azure subscription needed for MSTeams Bot creation

With the move of Microsoft to disable the App Registration on the legacy portal we created the Bot for our MSTeams APP in Azure portal that is part of the 'Renewable E5 subscription'.But we could not able to set the Bot messaging end point url. Earlier we can able to set that from the MSTeams' App Studio's Bot section but now it is not there. https://dev.botframework.com/ asks us to create a Azure Bot service.
Is it necessary to create a Azure Bot service in order to use and set the Bot message End point ?
If not how can we set the Bot messaging End point without Azure Bot service?
It does seem, now that the functionality is removed from App Studio, that you need to work in the Azure Portal directly (that's all it was doing behind the scenes). This would require an Azure subscription, but you can use any one, so you don't necessarily require an Azure subscription for each team member.
It is important to note though, that the only thing you really need in Azure is a bot "registration". There are two options when creating a bot resource in Azure - one includes a full hosting option ("web app bot"), and associated costs (based on the options selected), and the other is just a "channel registration", which has no cost at all.
When the bot is created, you need to go to it's "Settings" screen, as shown here, where you set the messaging endpoint, but you also need to make sure to go to the "Channels" option on the left menu, and make sure Teams is added as a channel ("channel" here means a platform you want to use your bot on, like Teams, facebook, slack etc.). If your bot had been created in App Studio previously, it would not need the Teams channel added manually, but for new bots it will.
Yes, You need azure subscription. Now you can not create bot from botframework.com. Everything is moved to Azure.

Azure Web Bot Service Reset Messaging EndPoint

When I setup a Bot service on Azure, an end point was automatically setup. I then wanted to debug locally so I used ngrok and copied this URL into the messaging endpoint. Stupidly, I didn't save a copy of the auto generated end point Azure provided. Now I'd like to go back to an Azure auto generated messaging endpoint however I'm unsure how to regenerate one to use. I've been informed that this is likely a security feature and to setup a new bot service again. Do I need to setup a new bot service or is there a way of regenerating a key in azure?
This depends on which type of Bot Service you created on Azure - there are two: Web App Bot and Bot Channels Registration. The latter is basically just a "registration" of a Bot in Azure + Bot Framework Services, and it's -intended- for you to host your bot wherever you like (Azure or otherwise). If you created a "Web App Bot" then it will create an Azure Web app at the same time, and the address will be based on that resource, plus an extra bit (see in a moment). To get the first part, the base address, check for the web app resource in Azure, and find it's regular Azure-generated address (I think it's like https://[whateverBotname].azurewebsites.net/). You should be able to visit that in the browser. Next is the "extra bit", which is simply the endpoint inside the app that the bot itself runs on (basically where the bot POST messages must go). By default its "/api/messages".
So, the full address would be https://[whateverBotname].azurewebsites.net/api/messages.
As an extra tip, if you want to change it again to test with NGrok, just paste the address in the Description field - it'll get Saved when you click the Save button.
As an extra extra tip - you can create the OTHER type of Bot - a "Bot Channels Registration" in Azure, which is JUST the registration, that you can use JUST for local development (you'll basically change the address every few hours, as your NGrok endpoint resets).
Hope that helps,

Azure deployed bot does not respond back

I have deployed a bot on Azure and its deployed to the web channel. I am using it through a website. It was also working through the web link a few hours back and now it does not. I didn't change the code or any settings in the services.
I am using node.js code and QnA maker services. Individual services are up and running.
Can someone help me what shall I tweak to access the bot from the web link again?
Thanks,
Vivek Jain

Cannot connect QnA maker into Bot Frameowrk Emulator

I am trying to load my QnA maker in addition to my QnA chat bot from Azure into Bot Framework Emulator.
I have been able to load my chat bot in successfully with it returning a response. I have entered the knowledge base data it required inside the Azure chat bot settings as well and the Visual Studio code (C#). But when I enter text into the chat bot inside of the bot framework emulator it replies with: Please set QnAKnowledgebaseId, QnAAuthKey and QnAEndpointHostName (if applicable) in App Settings. Learn how to get them at https://aka.ms/qnaabssetup.
Screen shot of what is displayed when I make contact with my chatbot inside of the bot framework emulator
Any help with resolving this issue would be greatly appreciated!
QnA Maker is generally available from May 2018. New architecture is built on Azure, where the runtime is now deployed on Azure App.
Now, if you are using new QnA Maker GA, it requires three parameters to get connect with Azure Bot Web App Bot. KnowledgebaseID, AuthKey & Host Name.
Host name is nothing but Web App URL deployed whiled creating QnA Maker service,
appname.azurewebsites.net/qnamaker
You have to provide this in Application Settings in Azure portal or alternatively in Constructor code part.
Thanks!

QnAmaker, can't find Channels tab

I deployed my QnAmaker chatbot using the new GA QnAmaker portal today. But after creating the knowledge base, i can't find the channels tab in Azure anymore.
In the channels tab, you could deploy the chatbot to different channels like Microsoft Teams or the Webchat.
Has anyone found this tab in Azure?
You just created your QnAMaker knowledge base and all the necessary items to use it (web app to host the service, Azure Search for the search part).
Now the next step is to create a bot by doing the following:
On Azure, create a Web App Bot
Use Question And Answer bot template in order to have the basic code to call QnAMaker already implemented
Once it is created, you will have at least the following resources: one Web App bot (to manage channels) and one App Service (hosting your bot code)
Go to the Web App Bot item
Select Application Settings menu, you will found several settings: QnAKnowledgebaseId, QnAAuthKey and QnAEndpointHostName
Fill those values with your QnA settings:
QnAKnowledgebaseId: it's your knowledge base Id on QnaMaker.ai website
QnAAuthKey: it's the Authorization EndpointKey value on QnaMaker.ai website (check https://www.qnamaker.ai/UserSettings)
QnAEndpointHostName: the endpoint location where you published your KB (also visible on https://www.qnamaker.ai/UserSettings)
Save
Then it's working ;-) and you can set the channels you want on the Channels menu of this Web App Bot item
Yes! It's still there. QnA MAker going GA has no impact on its functionalities but the way of implementation to some extent, which is of course in a good sense.
You Can find it on Azure Portal => Web App Bot => Bot Management section
Happy Coding!

Resources