在devops pipelin中从Prowershell访问Azure Cli

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

我目前正在从事需要通过Powershell访问kubernetes的管道工作。唯一的问题是我需要登录Az cli。对于测试,我使用我的个人凭据,显然不是一个好的最终选择。是否可以替代使用Azure CLI登录的任何其他选项?enter image description here

kubernetes devops pipeline credentials azure-cli
1个回答
0
投票

我猜您正在使用托管代理,因此,您需要在托管代理上配置kube.config

为了执行此操作,请运行az aks get-credentials --name $(CLUSTER_NAME) --resource-group $(RESOURCE_GROUP_NAME)

enter image description here

在托管代理上配置kube.config后,您可以运行所需的任何kubectl命令(使用Powershell \ Bash \ CMD)。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.