【问题标题】:how to get object id and application id of kubernetes service principal azure如何获取 Kubernetes 服务主体 azure 的对象 ID 和应用程序 ID
【发布时间】:2020-09-10 11:59:04
【问题描述】:

是他们获取 Azure Kubernetes 服务的 Object id 和 application id 的一种方式

注意* kubernetes 服务的服务主体不在 Active Directory 中,它仅由 AKS 生成 并将其 Acrpull 角色分配给 ACR Container Registry

【问题讨论】:

标签: c# azure azure-active-directory azure-aks


【解决方案1】:

我认为您对 Azure Kubernetes Service 的服务主体有误解。

服务主体正是 Azure Kubernetes 服务的托管标识。

创建 Azure Kubernetes 服务 (AKS) 集群时,需要为其配置身份验证方法。这里我选择“系统分配的托管标识”。

之后,你可以在Azure AD -> 企业应用程序 -> 所有应用程序中找到它(只要搜索Azure的名称Kubernetes 服务 (AKS) 集群)。但它在 Azure AD -> 应用程序注册中不可用。

另一种快速方法是使用 Azure CLI。参考here

创建 AKS 群集:

az aks create -g myResourceGroup -n myManagedCluster --enable-managed-identity

然后使用以下命令查询你的控制平面托管身份的objectid:

az aks show -g myResourceGroup -n myManagedCluster --query "identity"

此外,如果您尝试在 Azure 门户中使用此服务主体将角色分配给 ACR 容器注册表,则无需输入对象 ID。输入AKS集群的名字就够了。

【讨论】:

    猜你喜欢
    • 2020-01-05
    • 1970-01-01
    • 2022-12-05
    • 2022-10-06
    • 2020-01-05
    • 2020-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多