如何使用计算目标获取现有的 AKS

How to get the existing AKS using compute target

如何从我已经添加到 AML 的笔记本中获取现有的 AKS。 创建集群

attach_config = AksCompute.attach_configuration(resource_id=resource_id)
aks_target = ComputeTarget.attach(workspace=ws, name=create_name, attach_configuration=attach_config)
aks_target.wait_for_completion(True)

列出工作区内的所有 ComputeTarget 对象: 请按照以下link。 https://docs.microsoft.com/en-us/python/api/azureml-core/azureml.core.compute.computetarget?view=azure-ml-py#list-workspace-

你可以像下面这样做。

from azureml.core.compute import AksCompute, ComputeTarget
aks_name = 'YOUR_EXISTING_CLUSTER_NAME’
aks_target =AksCompute(ws, aks_name)