Azure-cli: az aks prints incorrect error if resource group doesn't exist.

Created on 16 Apr 2018  路  5Comments  路  Source: Azure/azure-cli

If you try to create an AKS cluster and the target resource group doesn't exist, the error message isn't very clear on what the issue is:

Bens-MacBook:~ ben$ 
Bens-MacBook:~ ben$ 
Bens-MacBook:~ ben$ az aks create --resource-group myResourceGroup --name myAKSCluster
Finished service principal creation[##################################]  100.0000%Operation failed with status: 'Bad Request'. Details: Changing property 'servicePrincipalProfile.clientId' is not allowed.

Environment summary

Last login: Mon Apr 16 11:53:35 on ttys000
Bens-MacBook:~ ben$ az --version
azure-cli (2.0.29)

acr (2.0.22)
acs (2.0.28)
advisor (0.5.0)
appservice (0.1.29)
backup (1.0.7)
batch (3.1.11)
batchai (0.1.6)
billing (0.1.7)
cdn (0.0.13)
cloud (2.0.12)
cognitiveservices (0.1.11)
command-modules-nspkg (2.0.1)
configure (2.0.14)
consumption (0.2.2)
container (0.1.19)
core (2.0.29)
cosmosdb (0.1.19)
dla (0.0.18)
dls (0.0.19)
eventgrid (0.1.11)
eventhubs (0.1.0)
extension (0.0.10)
feedback (2.1.0)
find (0.2.8)
interactive (0.3.17)
iot (0.1.18)
keyvault (2.0.20)
lab (0.0.17)
monitor (0.1.3)
network (2.0.25)
nspkg (3.0.2)
profile (2.0.20)
rdbms (0.1.0)
redis (0.2.11)
reservations (0.1.1)
resource (2.0.25)
role (2.0.20)
servicebus (0.1.0)
servicefabric (0.0.11)
sql (2.0.23)
storage (2.0.27)
vm (2.0.28)

Python location '/usr/local/opt/python/bin/python3.6'
Extensions directory '/Users/ben/.azure/cliextensions'

Python (Darwin) 3.6.4 (default, Mar 16 2018, 11:59:17)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]

Legal docs and information: aka.ms/AzureCliLegal

Bens-MacBook:~ ben$


AKS Service Attention

Most helpful comment

I am getting the same error. Deleting aksServicePrincipal.json and trying again did not help.

Operation failed with status: 'Bad Request'. Details: Changing property 'servicePrincipalProfile.clientId' is not allowed.

All 5 comments

Looks like the same thing happens on Power Shell as well.

@benofben I can't reproduce the error.

$ az aks create --resource-group bogus --name myAKSClsuter
Resource group 'bogus' could not be found.

I am getting the same error. Deleting aksServicePrincipal.json and trying again did not help.

Operation failed with status: 'Bad Request'. Details: Changing property 'servicePrincipalProfile.clientId' is not allowed.

Since the check for the existence of the resource group is the first thing the CLI does here, I think the errors reported are mistaken. It's more likely the RG and Cluster do exist--this is the error you would get when trying to create a new cluster over an existing one.

We've never been able to reproduce this. The error message is immediate and clear:

$ az aks create -g bogus -n MyCluster
Resource group 'bogus' could not be found.

This was reported while AKS was still in preview, so it's possible there was a CLI bug that's been fixed since then, although I cant' find one specific to this. @tjprescott let's close this issue.

Was this page helpful?
0 / 5 - 0 ratings