0

I am trying to build a LUIS Bot with SDK 4 (in .Net Framework, not .Net Core) but I cannot get past adding my luis service.

I am receiving this error:

System.ArgumentException: '"southeastasia" is not a valid LUIS endpoint.'

In this line:

var app = new LuisApplication(luis.AppId, luis.SubscriptionKey, luis.Region);

I followed the guide for .bot settings here: https://github.com/Microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/12.nlp-with-luis

My endpoint is: https://southeastasia.api.cognitive.microsoft.com/luis/v2.0/apps/{LuisAppID}?subscription-key={LuisSubscriptionKey}&timezoneOffset=-360&q=

And this is in my .bot file:

{
      "type": "luis",
      "name": "LuisBot", 
      "id": "",
      "appId": "{LuisAppID}",
      "subscriptionKey": "{LuisSubscriptionKey}",
      "version": "0.1",
      "region": "southeastasia"
    },

If I use the empty constructor for LuisApplication() and then set the app.Endpoint = "southeastasia", there is no error afterwards. Can it be a problem with the LuisApplication constructor that accepts Endpoint parameter?

Oyen
  • 344
  • 2
  • 14
  • 1
    https://stackoverflow.com/questions/52231169/azure-keys-for-luis-not-available – Kirsten Oct 02 '18 at 04:11
  • 1
    Possible duplicate of [Azure keys for Luis not available](https://stackoverflow.com/questions/52231169/azure-keys-for-luis-not-available) – Kirsten Oct 02 '18 at 04:12
  • @KirstenGreed I checked the link and it does not seem to be a duplicate. I have had this LUIS app published for several months now. Also note that if I use the LuisApplication() empty constructor and set Endpoint to "southeastasia", then there is no such error. – Oyen Oct 02 '18 at 20:35
  • See the note in the question I linked. "If you are publishing LUIS app in Australia, you need to set up the LUIS services in Australia East only." – Kirsten Oct 02 '18 at 21:14
  • 1
    Hi Oyen! I'm unable to reproduce this, because my LUIS app is automatically created in westus. However, in the new v4 LUIS sample bot, I noticed the line was ""var app = new LuisApplication(luis.AppId, luis.AuthoringKey, luis.GetEndpoint());"" Can you try that, instead of the line of code you have in your question, and let me know? It looks like the only change is the end GetEndpoint vs Region. – JJ_Wailes Oct 03 '18 at 22:30
  • 1
    @JJ_Wailes that worked! It worked the same as using the empty LuisApplication() constructor and then setting the Endpoint afterwards. – Oyen Oct 04 '18 at 00:40

1 Answers1

1

V4 had some variables change names. In your code snippet, you had:

var app = new LuisApplication(luis.AppId, luis.SubscriptionKey, luis.Region);

The new variable names and way of declaring LuisApplication is:

var app = new LuisApplication(luis.AppId, luis.AuthoringKey, luis.GetEndpoint())
JJ_Wailes
  • 2,207
  • 1
  • 9
  • 17