LUIS 中的 400 错误请求:找不到指定的订阅

400 Bad Request in LUIS: Cannot find the specified subscription

我正在使用 LUIS 编程创建一个 LUIS 应用 API。成功创建和训练应用程序后,我想使用此端点为应用程序分配一个 API 密钥:

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

我的编程 API 密钥(从 luis.ai 获得)和普通 API 密钥(我尝试分配的密钥,从 Azure 门户获得)都注册到相同的电子邮件地址。

但是,当我尝试向上述端点发送请求时,它失败并出现此错误:

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

我不知道我可能做错了什么,因为完全相同的逻辑之前已经起作用了。

有什么方法可以"assign" Azure 订阅我的 LUIS 帐户吗?

更新:

我没有找到问题的答案,但我找到了解决方法。调用 PUT /luis/api/v2.0/apps/{appId}/settings 会将应用程序设置为 "public",这意味着您可以使用任何订阅密钥。参见 docs

似乎这个端点现在已被弃用,因为我得到以下信息:

{
    "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."
    }
}

在 luis 页面我看到了这个:

端点 PUT /luis/api/v2.0/apps/{appId}/versions/{versionId}/assignedkey/luis/api/v2 .0/subscriptions 确实已弃用。我联系了 LUIS 支持,他们回答说:

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.