1
votes

I am creating a LUIS app using the LUIS programmatic API. After the app is successfully created and trained, I want to assign an API key to the app using this endpoint:

PUT /luis/api/v2.0/apps/{appId}/versions/{versionId}/assignedkey

Both my programmatic API key (obtained from luis.ai) and the normal API key (the one I am trying to assign, obtained from Azure Portal) are registered to the same email address.

However, when I am trying to send a request to the above endpoint, it fails with this error:

{
  "error": {
    "code": "BadArgument",
    "message": "Cannot find the specified subscription"
  }
}

I'm out of ideas for what I might be doing wrong, because exactly the same logic already worked before.

Is there some kind of way to "assign" an Azure subscription to my LUIS account?

Update:

I didn't find an answer to my question, but I found a workaround. Calling PUT /luis/api/v2.0/apps/{appId}/settings will set the application to "public", which means you can use any subscription key with it. See docs.

2

2 Answers

1
votes

It seems that this endpoint is now deprecated because I get the following:

{
    "error": {
        "code": "DeprecatedException",
        "message": "To assign a subscription key to an app, please go to the LUIS website at https://www.luis.ai and assign it from the app publish page."
    }
}

In the luis page I see this:

enter image description here

1
votes

The endpoint PUT /luis/api/v2.0/apps/{appId}/versions/{versionId}/assignedkey and /luis/api/v2.0/subscriptions are indeed deprecated. I contacted to LUIS support and they answered:

We are shifting the key management experience to happen only through the portal. Users no longer need to copy and paste keys, we offer a well-integrated experience that lists all the Azure keys inside our portal, key management details here.