azure - 如何找到 AKS 群集的服务主体 secret ?

标签 azure azure-active-directory azure-container-service azure-aks

好吧,我搞砸了,我不小心对我们的 AKS 集群运行的服务主体运行了 az ad sp reset-credentials。现在我们收到如下错误:

Error creating load balancer (will retry): error getting LB for service test/admin-api: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.azure.com/subscriptions/****/resourceGroups/MC_****/providers/Microsoft.Network/loadBalancers?api-version=2017-09-01: StatusCode=0 -- Original Error: adal: Refresh request failed. Status Code = '401'. Response body: {"error":"invalid_client","error_description":"AADSTS70002: Error validating credentials. AADSTS50012: Invalid client secret is provided.\r\nTrace ID:****\r\nCorrelation ID:**** \r\nTimestamp: 2018-08-23 12:01:33Z","error_codes":[70002,50012],"timestamp":"2018-08-23 12:01:33Z","trace_id":"****","correlation_id":"****"}

Failed to pull image "****.azurecr.io/****:****": rpc error: code = Unknown desc = Error response from daemon: Get https://****.azurecr.io/v2/****/manifests/****: unauthorized: authentication required

现在我想找到服务主体使用的原始客户端 key ,以便我可以将其重新添加为服务主体的 key 。除了重新创建整个集群之外,这是我能想到的唯一解决方案。

有什么想法吗?

最佳答案

最终解决方案非常简单。

  • 在 Azure 门户中,导航到名为 MC_<resourcegroup>_<aksName>_<region> 的资源组。
  • 点击“虚拟机”类型的资源之一。
  • 向下滚动到“运行命令”

Run command

  • 选择“RunShellScript”
  • 输入cat /etc/kubernetes/azure.json然后点击“运行”

该命令将返回 JSON 文件的内容。您需要的属性是aadClientSecret

关于azure - 如何找到 AKS 群集的服务主体 secret ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51985568/

相关文章:

azure - 无法安装 Az 模块

azure - 按计划仅运行一项构建管道任务

Azure 容器服务未创建代理节点

Azure Active Directory - 新门户中的访问被拒绝

c# - 还原已删除的目录 Azure Active Directory 对象 - Azure Graph API

azure-container-service - Azure 容器实例陷入 "Creating"状态

适用于容器的 Azure Web 应用程序 : how to password protect

azure - Windows 2008 R2 SP1 核心上的服务总线 1.1 安装失败

azure - Windows Azure 新门户上的 'LINKED RESOURCES' 是什么意思?

azure-active-directory - 使用 MSAL 实现 AAD 身份验证时,我将使用 navigateToLoginRequestUrl 选项做什么?