Service Principal cache file not getting generated when using az aks create
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
- Using Powershell 5
- Tested with Terminal, Powershell, cmd both with and without admin privileges.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/aks-pm.
aks
routing to aks team
@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
Yeah, I am aware of this, In fact I am using a managed identity for now.
Looks like this answer was addressed above, so closing this issue.
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.