2

I recently reached the limit for the free LUIS usage. I first created the LUIS app directly on the LUIS.ia portal and used those keys on my code. Now I wanted to get the paid option to continue using it so I created an azure resource for LUIS.ia I then went to the LUIS.ia app and added the azure resource throught the Publish>>Add Key on the LUIS.ia portal. I then changed on my code the subscriptionKey for one of the two from the new keys but it is still not working. What did I do wrong?

Alejandro Peña
  • 131
  • 2
  • 10

1 Answers1

2

One answer that probably isn't applicable at this time is that it will take time for an Azure resource to successfully propogate throughout Azure. What this means in the case of newly created LUIS Subscription keys, is that it can take up to ten minutes for a newly created LUIS Subscription Key in Azure to be valid to LUIS.

However, the steps you outlined indicate that you might be missing this next part.

After you created the key in Azure, you should have associated the key with the LUIS application you wish to use it with. Following a successful LUIS Subscription Key association in the LUIS Portal with one of your applications, the next step is to continue to your bot's code and change the previous key, to your new key.


Depending on which the error codes you're getting when you try to use LUIS will help with unblocking you.

If you're getting a 401, that means the key you're using is invalid, which might mean either the wrong region, or that the key hasn't finished propagating.

If it's a 403, that usually means you're out of your monthly quota, which would imply that the key being used in your LUIS queries are of the free-tier or is the Authoring/Programmatic API Key, so the key needs to be replaced with your paid-tier LUIS Subscription Key.


Edit for BotBuilder .NET v3 users:

For users of the .NET v3 SDK, when instantiating the LuisModel, if you are using a region other than westus, you must pass in the correct domain. An example of this in action can be found here, but I've also included the code below:

[LuisModel("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX",
    "XXXXXXXXXXXXXXXXX", domain: "eastus2.api.cognitive.microsoft.com")]
Steven G.
  • 1,632
  • 1
  • 11
  • 14
  • Okay thank you, I have tried this and now I can see the code of error which is a 401 error. I believe the keys are good so it might be the region, how do I call the right region? The previous region was: westus and the region on the new keys is southcentralus. I am using the method [LuisModel( modelID: "xxxxxxxxxxxxxxxxxxx", subscriptionKey: "xxxxxxxxxxx")] to call the Luis Model. – Alejandro Peña Apr 10 '18 at 05:26
  • @AlejandroPeña I've edited my answer to include how to set the domain, under "**Edit for BotBuilder .NET v3 users**" – Steven G. Apr 10 '18 at 17:35
  • @StevenG. Sir could you help me too about this problem. Using botframework v4 – user10860402 Mar 03 '19 at 21:38