title: Can't call Luis in Azure bot framework
body: <p><a href="https://i.stack.imgur.com/t6Wxx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/t6Wxx.png" alt="enter image description here"></a>I am a noob in dotnet as well as on Luis and bot framework. </p>
  
  <p>I am trying to make some bot samples work on my machine from </p>
  
  <p><a href="https://github.com/microsoft/BotBuilder-Samples" rel="nofollow noreferrer">https://github.com/microsoft/BotBuilder-Samples</a>.</p>
  
  <p>I am interested in this one particularly in </p>
  
  <p><a href="https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/13.core-bot" rel="nofollow noreferrer">https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/13.core-bot</a></p>
  
  <p>When i run the bot, it does not connect to Luis (see error message below).</p>
  
  <ul>
  <li>I created and published an app in Luis by importing the intent supplied in the app. </li>
  <li>I wrote LuisAppId,LuisAPIKey and LuisAPIHostName in the correct JSON file (see below). </li>
  <li>I added the dotnet library to the project : dotnet add package Cognitive.LUIS.Programmatic</li>
  </ul>
  
  <p>I then just run the code with the <code>cmd "dotnet run"</code> in the correct folder. </p>
  
  <p>Here the <em>app.setting</em> JSON. I used subscription-key as LuisAPIKey, and app ID as LuisAppId. </p>
  
  <pre><code>{
    "MicrosoftAppId": "",
    "MicrosoftAppPassword": "",
    "LuisAppId": "2aa2b9c5-#######################7b557",
    "LuisAPIKey": "1069d###############4347da9",
    "LuisAPIHostName": "westus.api.cognitive.microsoft.com/luis/api/v2.0"
  }
  </code></pre>
  
  <p>The bot is running on my localhost. But it just does not work.</p>
  
  <blockquote>
    <p>bot : What can I help you with today? Say something like “Book a
    flight from Paris to Berlin on March 22, 2020”</p>
    
    <p>me : “Please Book a flight from Paris to Berlin on March 22, 2020”  </p>
    
    <p>bot :"The bot encounted an error or bug."</p>
    
    <p>bot :"To continue to run this bot, please fix the bot source code"</p>
  </blockquote>
  
  <pre><code>
  On the cmd line : 
  "fail: Microsoft.Bot.Builder.Integration.AspNet.Core.BotFrameworkHttpAdapter[0]
        [OnTurnError] unhandled error : Operation returned an invalid status code 'NotFound'
  Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models.APIErrorException: Operation returned an invalid status code 'NotFound'
     at Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Prediction.ResolveWithHttpMessagesAsync(String appId, String query, Nullable`1 timezoneOffset, Nullable`1 verbose, Nullable`1 staging, Nullable`1 spellCheck, String bingSpellCheckSubscriptionKey, Nullable`1 log, Dictionary`2 customHeaders, CancellationToken cancellationToken)
     at Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.PredictionExtensions.ResolveAsync(IPrediction operations, String appId, String query, Nullable`1 timezoneOffset, Nullable`1 verbose, Nullable`1 staging, Nullable`1 spellCheck, String bingSpellCheckSubscriptionKey, Nullable`1 log, CancellationToken cancellationToken)
     at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer.RecognizeInternalAsync(ITurnContext turnContext, LuisPredictionOptions predictionOptions, Dictionary`2 telemetryProperties, Dictionary`2 telemetryMetrics, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.AI.LUIS\LuisRecognizer.cs:line 345
     at Microsoft.Bot.Builder.AI.Luis.LuisRecognizer.RecognizeAsync[T](ITurnContext turnContext, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.AI.LUIS\LuisRecognizer.cs:line 163
     at Microsoft.BotBuilderSamples.FlightBookingRecognizer.RecognizeAsync[T](ITurnContext turnContext, CancellationToken cancellationToken) in C:\Users\flabare\botbuilder-samples\samples\csharp_dotnetcore\13.core-bot\FlightBookingRecognizer.cs:line 38
     at Microsoft.BotBuilderSamples.Dialogs.MainDialog.ActStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) in C:\Users\flabare\botbuilder-samples\samples\csharp_dotnetcore\13.core-bot\Dialogs\MainDialog.cs:line 67
     at Microsoft.Bot.Builder.Dialogs.WaterfallDialog.OnStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.Dialogs\WaterfallDialog.cs:line 166
     at Microsoft.Bot.Builder.Dialogs.WaterfallDialog.RunStepAsync(DialogContext dc, Int32 index, DialogReason reason, Object result, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.Dialogs\WaterfallDialog.cs:line 188
     at Microsoft.Bot.Builder.Dialogs.WaterfallDialog.ResumeDialogAsync(DialogContext dc, DialogReason reason, Object result, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.Dialogs\WaterfallDialog.cs:line 113
     at Microsoft.Bot.Builder.Dialogs.DialogContext.EndDialogAsync(Object result, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.Dialogs\DialogContext.cs:line 196
     at Microsoft.Bot.Builder.Dialogs.Prompt`1.ContinueDialogAsync(DialogContext dc, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.Dialogs\Prompts\Prompt.cs:line 147
     at Microsoft.Bot.Builder.Dialogs.DialogContext.ContinueDialogAsync(CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.Dialogs\DialogContext.cs:line 160
     at Microsoft.Bot.Builder.Dialogs.ComponentDialog.ContinueDialogAsync(DialogContext outerDc, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.Dialogs\ComponentDialog.cs:line 84
     at Microsoft.Bot.Builder.Dialogs.DialogContext.ContinueDialogAsync(CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.Dialogs\DialogContext.cs:line 160
     at Microsoft.Bot.Builder.Dialogs.DialogExtensions.RunAsync(Dialog dialog, ITurnContext turnContext, IStatePropertyAccessor`1 accessor, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder.Dialogs\DialogExtensions.cs:line 18
     at Microsoft.BotBuilderSamples.Bots.DialogBot`1.OnMessageActivityAsync(ITurnContext`1 turnContext, CancellationToken cancellationToken) in C:\Users\flabare\botbuilder-samples\samples\csharp_dotnetcore\13.core-bot\Bots\DialogBot.cs:line 48
     at Microsoft.BotBuilderSamples.Bots.DialogBot`1.OnTurnAsync(ITurnContext turnContext, CancellationToken cancellationToken) in C:\Users\flabare\botbuilder-samples\samples\csharp_dotnetcore\13.core-bot\Bots\DialogBot.cs:line 36
     at Microsoft.Bot.Builder.BotFrameworkAdapter.TenantIdWorkaroundForTeamsMiddleware.OnTurnAsync(ITurnContext turnContext, NextDelegate next, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder\BotFrameworkAdapter.cs:line 995
     at Microsoft.Bot.Builder.MiddlewareSet.ReceiveActivityWithStatusAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder\MiddlewareSet.cs:line 55
     at Microsoft.Bot.Builder.BotAdapter.RunPipelineAsync(ITurnContext turnContext, BotCallbackHandler callback, CancellationToken cancellationToken) in d:\a\1\s\libraries\Microsoft.Bot.Builder\BotAdapter.cs:line 167"
  
  </code></pre>
  
  <p>As mentioned I am new to this, so any insights on the above would be greatly appreciated!</p>