在 DBX 中调用 AML 模型- HTTP 错误 401:未经授权

问题描述 投票:0回答:0

您好,我已经在 AML 中向 AKS 集群部署了一个模型,我正在尝试通过其在 DBX 中的端点调用它。 我能够通过用于部署其他模型的同一 AKS 集群的不同端点获得响应,但我收到 HTTP 错误 401:此错误未经授权。

   body = str.encode(json.dumps(final_dict))
url = aml_endpoint
api_key = aml_endpoint_key
headers = {
    "Content-Type": "application/json",
    "Authorization": ("Bearer " + api_key),
}
req = urllib.request.Request(url, body, headers)
context = ssl._create_unverified_context()
respone = urllib.request.urlopen(req,context=context)

result_bytes = response.read()

这里有人熟悉 AML 并且知道此错误的原因吗?

非常感谢任何帮助!

azure-aks azure-machine-learning-service azure-machine-learning-studio dbx azure-machine-learning-workbench
© www.soinside.com 2019 - 2024. All rights reserved.