Hello i publish my bot to azure and have this error when i tested it on messenger. I downloaded the publish settings on my azure app and import it to the bot via Visual Studio. I have done this many times before but this is my first time publishing on the latest botframework design.
This bot is working fine on bot emulator including luis, qnaMaker and dispatch services.
I saw this question but LuisAPIHostName in my appsettings.json is already set to region.
Any idea how to solve this? Thank you I can see the error because of this code
public class AdapterWithErrorHandler : BotFrameworkHttpAdapter
{
private const string ErrorMsgText = "Sorry, it looks like something went wrong.";
public AdapterWithErrorHandler(IConfiguration configuration, ILogger<BotFrameworkHttpAdapter> logger, ConversationState conversationState = null)
: base(configuration, logger)
{
OnTurnError = async (turnContext, exception) =>
{
// Log any leaked exception from the application.
logger.LogError($"Exception caught : {exception.Message}");
// Send a catch-all apology to the user.
var errorMessage = MessageFactory.Text(ErrorMsgText + exception.Message, ErrorMsgText, InputHints.ExpectingInput);
await turnContext.SendActivityAsync(errorMessage);
My appsettings:
{
"Logging": {
"LogLevel": {
"Default": "Warning"
}
},
"MicrosoftAppId": "",
"MicrosoftAppPassword": "",
"DispatchLuisAppId": DispatchAppId,
"DispatchLuisAPIKey": DispatchAPIKey,
"DispatchLuisAPIHostName": "southeastasia",
"LuisAppId": LuisAppId,
"LuisAPIKey": LuisAPIKey,
"LuisAPIHostName": "southeastasia",
"QnAKnowledgebaseId": QnaMakerKBId,
"QnAEndpointKey": QnaMAkerEndpointKey,
"QnAEndpointHostName": QnaMakerEndpointHostName,
"AllowedHosts": "*"
}
botServices:
public class BotServices : IBotServices
{
public BotServices(IConfiguration configuration)
{
DispatchService = new LuisRecognizer(new LuisApplication(
configuration["DispatchLuisAppId"],
configuration["DispatchLuisAPIKey"],
$"https://{configuration["DispatchLuisAPIHostName"]}.api.cognitive.microsoft.com"),
new LuisPredictionOptions { IncludeAllIntents = true, IncludeInstanceData = true },
true);
LuisService = new LuisRecognizer(new LuisApplication(
configuration["LuisAppId"],
configuration["LuisAPIKey"],
$"https://{configuration["LuisAPIHostName"]}.api.cognitive.microsoft.com"),
new LuisPredictionOptions { IncludeAllIntents = true, IncludeInstanceData = true },
true);
QnaService = new QnAMaker(new QnAMakerEndpoint
{
KnowledgeBaseId = configuration["QnAKnowledgebaseId"],
EndpointKey = configuration["QnAEndpointKey"],
Host = configuration["QnAEndpointHostName"]
});
}
public LuisRecognizer DispatchService { get; private set; }
public LuisRecognizer LuisService { get; private set; }
public QnAMaker QnaService { get; private set; }
}
Dispatch keys and endpoint
LUIS keys and endpoint
wwwroot
emulator with working luis,dispatch and qna(btw the error only appears when i click "trace" in the emulator)
UPDATE
i changed appsettings to
"DispatchLuisAPIHostName": "southeastasia.api.cognitive.microsoft.com",
and botservice to
$"https://{configuration["DispatchLuisAPIHostName"]}"),
In messenger, it is now replying but detecting everything i type as "cancel" intent. I added a code to see intent and you can see the difference between emulator and messenger.
I typed the same thing on emulator but luis,qna and dispatch is working fine.