Reputation: 2532
I'm currently working on a pipeline job that requires kubernetes access through powershell.
The only issue is that I need to sign in for Az cli. For testing I'm using my personal credentials, clearly not a good definitive option. Are there any other options for Azure cli login that could be used instead?
Upvotes: 1
Views: 1019
Reputation: 8152
I'm guessing you are working with hosted agents, therefore, you need to configure kube.config
on the hosted agent.
in order to do that, run az aks get-credentials --name $(CLUSTER_NAME) --resource-group $(RESOURCE_GROUP_NAME)
. The easiest way is to use Azure CLI
task. Be aware that this task required authorization from Azure DevOps to Azure.
More info can be found here.
In case you are the subscription owner- select your subscription and click on Authorize
.
When the kube.config
configured on the hosted agent, you can run any kubectl
command you wish (Using Powershell\Bash\CMD).
Upvotes: 1