I have a bot made in framework v4 using c#.it is using luis in it. It was working fine before but now it is giving error like Sorry, it looks like something went wrong: Operation returned an invalid status code ‘Forbidden’ It is issue related with luis. Plez any can help me. I am also attaching the trace coming in emulator
Source: "Microsoft.Azure.CognitiveServices.Language.LUIS"
StackTrace: " at Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Prediction.ResolveWithHttpMessagesAsync(String appId, String query, Nullable1 timezoneOffset, Nullable
1 verbose, Nullable1 staging, Nullable
1 spellCheck, String bingSpellCheckSubscriptionKey, Nullable1 log, Dictionary
2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.PredictionExtensions.ResolveAsync(IPrediction operations, String appId, String query, Nullable1 timezoneOffset, Nullable
1 verbose, Nullable1 staging, Nullable
1 spellCheck, String bingSpellCheckSubscriptionKey, Nullable1 log, CancellationToken cancellationToken)
at Microsoft.Bot.Builder.AI.Luis.LuisRecognizerOptionsV2.RecognizeInternalAsync(ITurnContext turnContext, HttpClient httpClient, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.AI.LUIS\LuisRecognizerOptionsV2.cs:line 72
at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer.RecognizeInternalAsync(ITurnContext turnContext, LuisRecognizerOptions predictionOptions, Dictionary
2 telemetryProperties, Dictionary2 telemetryMetrics, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.AI.LUIS\LuisRecognizer.cs:line 467
at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer.RecognizeAsync(ITurnContext turnContext, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.AI.LUIS\LuisRecognizer.cs:line 173
at LuminousSaathiBot.Bots.SaathiDialogBot
1.OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken) in C:\LuminousSaathiBot\LuminousSaathiBot\Bots\SaathiDialogBot.cs:line 40
at LuminousSaathiBot.Middleware.HandoffMiddleware.OnTurnAsync(ITurnContext context, NextDelegate next, CancellationToken ct) in C:\LuminousSaathiBot\LuminousSaathiBot\Middleware\HandoffMiddleware.cs:line 147
at Microsoft.Bot.Builder.Core.Extensions.CatchExceptionMiddleware`1.OnTurnAsync(ITurnContext context, NextDelegate next, CancellationToken cancellationToken) in C:\LuminousSaathiBot\LuminousSaathiBot\Middleware\CatchExceptionMiddleware.cs:line 34"
valueType: "APIErrorException"
It sounds like something's wrong with your LUIS AppId or Subscription Key. You need to get these from the Manage section in LUIS, as shown below. Where you use these exactly, depends on how you configure your LUIS services in your Bot.