Azure-docs: az aks create command requires ServicePrincipleProfile

Created on 31 May 2019  Â·  5Comments  Â·  Source: MicrosoftDocs/azure-docs

Running the following command to create the cluster fails with the error:

Operation failed with status: 'Bad Request'. Details: The credentials in ServicePrincipalProfile were invalid. Please see https://aka.ms/aks-sp-help for more details. (Details: adal: Refresh request failed. Status Code = '401'.

Command used

PASSWORD_WIN="P@ssw0rd1234"

az aks create \
    --resource-group shboyer-aks \
    --name shboyer-dev-cluster \
    --node-count 1 \
    --enable-addons monitoring \
    --kubernetes-version 1.14.0 \
    --generate-ssh-keys \
    --windows-admin-password $PASSWORD_WIN \
    --windows-admin-username azureuser \
    --enable-vmss \
    --network-plugin azure 

Even when --disable-rbac is passed, ServicePrincipal is required.

reference:
https://docs.microsoft.com/en-us/azure/aks/kubernetes-service-principal


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

container-servicsvc cxp product-question triaged

Most helpful comment

Updated the service principal doc to add a troubleshooting note to check for credential file expiration. That PR has merged and will go live during the next publication cycle early Monday morning PST.

All 5 comments

Thanks for the feedback! We are currently investigating and will update you shortly.

@spboyer could it be your local cached SP credentials have expired?

Try to delete your cached $HOME/.azure/aksServicePrincipal.json or explicitly pass the SP parameters via
--service principal <SP_ID> --client-secret <SP_Password>

@palma21 Good point. file created 02/07/2018. Year has passed. Error message should be better.

--disable-rbac should not look for the file, nor principal though correct?

it will always look for the SP in other to give it permissions as network contrib to the azure subnet. will also need it later on to expose svcs through LBs.

We just added that message which is now doing pre-flight validation of the SPs credentials to avoid clusters in a bad state. Let me see how we can improve the text, thanks for the feedback.

Updated the service principal doc to add a troubleshooting note to check for credential file expiration. That PR has merged and will go live during the next publication cycle early Monday morning PST.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jharbieh picture jharbieh  Â·  3Comments

JeffLoo-ong picture JeffLoo-ong  Â·  3Comments

bityob picture bityob  Â·  3Comments

Agazoth picture Agazoth  Â·  3Comments

paulmarshall picture paulmarshall  Â·  3Comments