azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Service Principal cache file not getting generated when using az aks create

Open SayakMukhopadhyay opened this issue 6 years ago • 7 comments

Describe the bug

I am using azure-cli through Powershell using Terminal. According to docs and other issues, when I trigger az aks create..., I expected a ~\.azure\aksServicePrincipal.json file but none is created. Thus everytime I create a cluster, a new service principle is generated in Azure AD. Command Name az aks create

Errors: None. Except the cache file is not created.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Put any pre-requisite steps here...
  • az aks create --resource-group {} --name {} --node-count {} --enable-addons {} --ssh-key-value {} --kubernetes-version {} --node-vm-size {} --node-count {}

Expected Behavior

Environment Summary

Windows-10-10.0.18362-SP0
Python 3.6.6
Installer: MSI

azure-cli 2.5.0

Additional Context

  1. Using Powershell 5
  2. Tested with Terminal, Powershell, cmd both with and without admin privileges.

SayakMukhopadhyay avatar Apr 29 '20 12:04 SayakMukhopadhyay

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/aks-pm.

ghost avatar Apr 29 '20 13:04 ghost

aks

yonzhan avatar Apr 29 '20 13:04 yonzhan

routing to aks team

yungezz avatar Apr 29 '20 23:04 yungezz

@SayakMukhopadhyay - to mitigate this issue, you can first explicitly create the service principal: az ad sp create-for-rbac --skip-assignment --name {} Then pass the app-id and password in to your az aks create command via parameters --service-principal and --client-secret

bpdohall avatar May 30 '20 04:05 bpdohall

Yeah, I am aware of this, In fact I am using a managed identity for now.

SayakMukhopadhyay avatar May 30 '20 05:05 SayakMukhopadhyay

Looks like this answer was addressed above, so closing this issue.

Jen7714 avatar May 30 '20 21:05 Jen7714

Hi @Jen7714 The workaround given above does not solve this issue so I dont think this issue should be closed. The CLI and the docs clearly states that on not supplying a service principle, one is created and is cached locally. This local caching is not happening.

SayakMukhopadhyay avatar May 31 '20 07:05 SayakMukhopadhyay