Unauthorized: Your bot is not configured to interact with LUIS app - azure

Working with the Azure enterprise bot model, everything is deployed, enabled and functioning. But all calls to LUIS are failing in the chatbot, both on desktop and in Azure's web environment. My LUIS model works in luis.ai when testing, but when connecting to LUIS from the bot I get the error below:
The only thing that does not work is the call to LUIS from the chatbot. It returns unauthorized. I've spent about 8 hours on google and verifying settings. Can somebody tell me where the checkbox is that i've missed?
Basic chatbot function is good.
microsoft app id and secret are good.
QNA maker implementation is good.
Publish cycles from Visual Studio is working fine.
I have verified the LUIS app functions in luis.ai.
I have verified all keys are properly written in cognitivemodels.json
I have verified all keys are correct by changing them incrementally, noting that the app fails, restoring to the correct value, and noting that the app functions.
trace results:
App ID:
Version: Unknown
Slot: Production
Recognizer ResultRaw Response
{
"recognizerResult": {
"alteredText": null,
"entities": {
"$instance": {}
},
"intents": {
"l_general": {
"score": 0.6153312
}
},
"text": "test"
}
}
Top-Scoring Intent
l_general (0.6153312)
Please add your LUIS service to enable reassigning.
Entities
No Entities
error from emulator log:
[LUIS] Unauthorized: Your bot is not configured to interact with LUIS app: . Please connect your bot to LUIS using the services pane.
The service pane appears, I add in all the keys and information as copied from luis.ai for the referenced appID. On save, the pane disappears and nothing changes.

This error looks to be specific to the Bot Framework Emulator as per this code.
I can reproduce the error locally by doing the following:
Debugging my bot.
Submitting a query that will trigger a request to LUIS.
Clicking on the hyperlinked trace text next to a LUIS Trace log entry in the log pane.
You aren't actually able to add a service to a bot without creating a bot configuration first (File > New Bot Configuration). Fill out the following:
Bot name
Endpoint URL (use your local one)
Microsoft App ID
Microsoft App password
Save and connect
Save the configuration somewhere
Then you will be able to add the services:
Click the + next to the Service.
Add your LUIS apps by filling out the dialogs.
Try the steps in the first set of my bullet points again and see if errors come through. If they do then you will need to add a service for the GUID that comes back in the error message - this GUID will match one of your LUIS app ids.
Even after doing this I still got the error message in the Log page, starting the emulator and bot didn't help. So I would advise raising an issue on the official GitHub for the Bot Framework Emulator about adding the services not working.

My AD password changed, Powershell had cached my credentials. Although I was not actively using powershell, apparently my credentials are locally cached on the dev box and used for some specific funcitons, which manifests as seemingly random authentication errors in logs. logging out of azure and logging back in (in powershell) resolved the issue.
Oh the hours of my life I will never get back.

Related

How do I find out the reason I cannot send messages to my bot?

I have set up a bot registration channel that connects to my bot's endpoint. It works perfectly fine in Bot Framework Emulator.
I am having problems connecting to my bot through the "Test in Web Chat" page on the Azure Portal. I try to send a message, but nothing happens and all I see under the message is "Sending".
I will then go to the "channels" tab in the blade and see an error for web-chat: There was an error sending this message to your bot: HTTP status code Unauthorized.
When I try sending a message to the bot in Microsoft Teams, absolutely nothing happens. I do not even get an error. Under health on the Azure Portal it just says "Running".
Getting my bot to work in the web chat is not top priority though. I really want it to work in teams in the end.
Wanted to comment but don't have enough points. There's a few different reasons for authorization. When creating the bot registration there's an option to 'only allow accounts from this organization', this needs extra configuration so if you picked this then change it to any account.
Also, you can often get more detailed error messages from the server's side (which aren't revealed to the user who gets hit with 403). Go to the bot's App service in Azure portal and go to "App Service Logs" near the bottom of the left menu. Enable "Application Logging (Filesystem)" (I also like to Level to Verbose and enable "Detailed Error messages" as well). Now go to "Log stream" in the left menu. It should now be connected. Try to access bot again and see what messages come in the log stream.
If you enable Application Insights that can also help
The main reasons for bots not getting called are either the address is incorrect (either the root location of some part of the address, depending on how you're hosting it. As an example, an Azure Function will automatically add an extra "/api" early in the path) or, as you're finding, something to with the AppId and AppPassword not getting picked up correctly.
If it's the latter, which is what it sounds like here, then in principle it's a simple fix - you just need to make sure your AppId and AppPassword are (a) correct from the portal and (b) getting used correctly in your bot configuration.
The problem comes in with (b) above - there are a whole bunch of different samples on the internet, from Microsoft and others, both for C# and Node, and they use a ton of different ways to instantiate the bot and set it's AppId and AppPassword. Some of the examples, for instance, use an implementation of an "ConfigurationCredentialProvider" internally, which will try pull the appid/apppassword from your configuration file, but of course expect them to be in a specifically-named set of values (see here for more).
So, can you check in however you've implemented your bot, to see where/how the credentials are getting set exactly?

How to resolve Luis - 403 Out of call volume quota

I am testing my bot for my school project which was due in next two days and suddenly, the bot stopped functioning correctly and showing the default message all the time.
After some research in Google and Stackoverflow, found it is due to Quota limit.
I see in the Luis keys, the current key is "Starter_key" and also below error message in the end-point.
{ "statusCode": 403, "message": "Out of call volume quota. Quota will be replenished in 11.00:25:53." }
I read similar problems here, but none of them clearly mentioned what next. What is the best possible way to overcome this and I dont want to wait for the next 11 days. Is there anyway to upgrade to pay-as-you-go only for Luis? or even that wont work?
As your error message indicates, you simply hit the max amount of request for your LUIS Starter_Key (which is sort of a trial).
To permanently resolve this issue you need to provision a LUIS resource on your Microsoft Azure Subscription and use the subscription keys from there.
The approach is well documented here.
In short:
Create a LUIS Resource within your Azure Subscription
Back in your LUIS portal go to Keys and Endpoints of your model
Click "Assign resource" and select the previously created LUIS Resource
I resolved the problem with below steps and this can be marked as closed.
Created New Luis app in luis.ai using different account.
Exported the existing account settings from My Apps -> Export as Json.
Imported the Json into new app under Manage -> Versions
Trained and published the new Luis app.
Copy the new app's App ID and API key and update them in the Bot Application settings --> LuisAPIKey and LuisAppId
Restart the Bot service.
Validate the Bot.

Azure Bot Associated Language Understanding (LUIS) App Not Showing

Per this tutorial, I created an Azure Bot web application (in the US region). It works fine, but the associated LUIS app is not showing.
the associated LUIS app is not showing
Firstly, as Jyo Fanidam mentioned in comment, please make sure you are using same email account to login Azure portal and LUIS web portal.
Secondly, there are three LUIS websites, based on region. If you selected West US as LUIS App location when you create Web App Bot, to access your LUIS app, please login to https://www.luis.ai using the same account you use to log in to Azure.
Please login to correct LUIS website based on LUIS App location that you specified on Azure portal.
LUIS websites:
Figured out my problem: User error. I was neglecting to click the 'Select' button when choosing the 'Language Understanding' Bot template. So, it was creating a Basic Bot instead of a LUIS Bot. Thought I would post my resolution in case someone else makes the same mistake.

QnA Maker - Azure Bot Service - Test in Web Chat not respondng

First, new to creating Bots so please be patient.
I created a KB using QnAMaker. Created new Bot in Azure Bot Service. New bot was created using Template for QnA. Followed the steps below per documentation:
In Azure portal, open the newly created Web App Bot resource.
Click on "Application Settings" and in the App Settings list, add QnASubscriptionKey and QnAKnowledgebaseId. The corresponding values can be obtained from the KB Settings page in http://qnamaker.ai.
The QnAMaker-enabled Azure bot service app is now ready to use. To try it out click on "Test in Web Chat" to chat with your QnA bot.
Test in Web Chat does not respond
Also created new App, using Basic template. Made to other updates. Test in We Chat does send a response.
Again, new to the process but have read a great deal of documentation but nothing that speaks to this issue specifically. Any help would be greatly appreciated.
I created a QnAMaker bot this weekend with Bot Service. The documentation is a little confusing at the moment, although Microsoft generally refines it over time until it's quite good. Here's what I did to get this going.
Provisioned a QnAMaker service at qnamaker.ai. I created a knowledge base, saved and retrained, and published. To make sure everything is good on the QnAMaker service, go to the Test tab (https://qnamaker.ai/Edit/Test?kbId=:your-service-id to make sure you can chat with it and it responds as expected.
Created a new Web App bot by going to the portal, clicking "Create a resource", choosing "AI + Cognitive Services", then "Web App Bot".
When entering the Web App Bot settings, I made sure to choose a Basic C# bot, and chose the "Question and Answer".
Once you provision the Web App Bot service, you'll also have a Web App provisioned as well. You'll need to create a web application that will answer requests from the web, hand them to your QnAMaker service, and return the results. Navigate to your Web App Bot service, then choose the Build menu option under Bot Management. Then Download the zip file containing your starter code.
Open the starter code. You'll need to add some keys to your web.config file. Make sure that you have keys for the following, and that they're populated: MicrosoftAppId, MicrosoftAppPassword, QnaSubscriptionKey, QnAKnowledgebaseId, and AzureWebJobsStorage. If memory serves, these values are read within the code, but there's no empty stubs in the web.config that prompts you to enter them. This was a little frustrating.
After updating web.config, publish the web app to your Azure Web App instance associated with your bot.
Now go back to your Web App Bot in the portal. Under Bot Management, go to the Settings page. You're going to need to enter in the Messaging endpoint so that your bot service knows where to send HTTP requests to your web app, which will in turn talk to your QnAMaker service. In this example project, your messaging endpoint should be https://[web app name].azurewebsites.net/api/messages.
NOW you're ready to Test in Web Chat. Everything should link up then.
I had this issue just now. It was caused by having extraneous data at the end of my QNA service key, something like (format=json) which somehow ended up after the key. I suggest you re-copy and paste the knowledgebase id and key into the fields and make sure they are the correct length with no garbage.
Apart from not returning responses it gave no other clue as to what might be wrong.

Impossible to choose any channel in Azure Bot Service

Since the new Azure Bot Service (released GA 2017-12-13), I've created a "WebAppBot" named "SanoBot" and I can't choose any channel to plug it for another services like Telegram: the page is empty when I click on "Channels". I've done a little screenshot to show you what I see:
I've check the documentation sent by the Azure Support from Twitter but the pages return 404 error.
Just to be clear: the bot works well and I can modify it from the Online Editor, build, deploy & test it. It's only "channels" feature that doesn't work.
Thanks for your help.
I can't use pictures because I haven't enough reputation...

Resources