如何在Azure门户(或Cloud Shell)中检索ACI部署的身份验证密钥?

时间:2019-05-31 10:58:23

标签: azureportal azure-aks azure-container-instances azure-cloud-shell azure-machine-learning-service

我创建了一个deployment on ACI with Azure ML service,它的状态良好。
部署时,我设置了auth_enabled=True,以便该服务需要授权密钥才能响应。

我可以通过以下方式在Python控制台的Azure ML服务工作区ws中获取该部署的服务授权密钥:

from azureml.core.webservice import Webservice
services = Webservice.list(ws)
services[0].get_keys()

但是,通过Azure门户或Cloud Shell访问此信息将很方便。

在Azure门户中(与AKS不同),没有显示身份验证字段,在尝试通过编辑部署访问“高级设置”时也是如此:

enter image description here

您能建议访问这些凭据的方法吗?

1 个答案:

答案 0 :(得分:1)

您可以通过运行将Azure Machine Learning CLI添加到Cloudshell中

az extension add -n azure-cli-ml

在那之后,您可以通过运行来检索任何服务的密钥

az ml service get-keys --name magical-service --workspace-name davide-workspace