Bad Argument, Invalid Subscription Key when trying to add key from Azure
Asked Answered
M

2

2

I am trying to set up my LUIS app in luis.ai (because it seems like I can't set it up in Azure directly?). Anyway, I have created a Language Understanding Intelligent Service (LUIS) (preview) resource, but when I enter one of the keys from that resource into "My Keys" in luis.ai, I get this error: "Bad Argument, Invalid Subscription Key"

Also, I just tried to publish an app with the bootstrap key and got the following errors:

{ "statusCode": 401, "message": "Access denied due to invalid subscription key. Make sure to provide a valid key for an active subscription." } enter image description here

Microelement answered 16/5, 2017 at 9:9 Comment(6)
I'm pretty sure your key does not correspond to the endpoint region you're trying to hit. Anyways, can't you use portal.azure.com/#create/Microsoft.CognitiveServicesLUIS?Nightwalker
I have exact same issue. I have tried subscriptions in West Europe and West US. I have used LUIS many times before so wondering if there is so issue.Canescent
I created a new one in the WestUS, waited 10 mints and it started working. Not sure why the others failed. I have added an issue to the User Voice.Canescent
It worked to go to eu.luis.ai and use west europe endpoint. Then the URI works, but I still can't make it work using the SDK... Any way to get the Android SDK to use the correct endpoint?Microelement
It also worked to create a new resource in WestUS and wait for 10 minutes before entering it into luis.ai. There it should probably work for the SDK as well. I would still like to know how to force the SDK to another endpoint.Microelement
Adding clarification notes for others encountering this: The West EU keys are bound to EU.LUIS.ai, attempting to use them in the LUIS.ai portal will indeed return the invalid key error. If you are using a West Europe subscription key for LUIS, you must use the European LUIS portal.Weathered
M
5

As provided in comments, the solution is to use a correct end-point. This is not clear anywhere, but for the luis.ai portal, I have to use WestUS endpoint.

If I change to useing eu.luis.ai, I have to use the WestEU end-point.

Microelement answered 4/6, 2017 at 17:16 Comment(0)
B
2

To use european LUIS endpoint within Bot Builder C# SDK, just modify Luis Model parameters as follows:

[LuisModel("YOUR-LUIS-APP-ID", "YOUR-LUIS-EUROPEAN-KEY", domain: "westeurope.api.cognitive.microsoft.com")]

Note that you'll need to export your LUIS app over EU.LUIS in order to access the correct endpoint.

Hope it helps.

Beanie answered 7/6, 2017 at 8:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.