aks engine tutorial deploy didn't work: can't open input file: az
Kubernetes version: mac, brew installed aks-engine and azure-cli.
aks-engine version: v0.32.1 azure-cli: 2.0.60
What happened: When I follow the step described in tutorial, "aks-engine deploy" didn't work as I expected.
It showed this message
aks-engine deploy --subscription-id 3ec0b1e5-8676-4855-bf51-a8b1092815b7
--auth-method cli
--dns-prefix contoso-apple
--resource-group contoso-apple
--location koreacentral
--api-model examples/kubernetes.json
--set servicePrincipalProfile.clientId="a9e0943a-b846-4a47-8859-*"
--set servicePrincipalProfile.secret="6551f548-6648-431e-86f7-"
" failed to load apimodel: failed to get client: Invoking Azure CLI failed with the following error: /bin/zsh: can't open input file: az"
I didn't know this error caused by my wrong zsh setting or aks-engine bug.
👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it.
can you run azure-cli commands locally? az --version for example
I don't think this is an aks-engine bug (haven't seen this reported anywhere else), most likely the error is what it says it is: zsh can't run az (azure-cli).
@CecileRobertMichon I got the same error. I use zsh and can run az --version
weird...I use zsh too and I'm not seeing any errors. My guess is it has something to do with your az install. Where is yours located? Mine is in
which az
/usr/local/bin/az
Mine is
which az
/usr/bin/az
Maybe aks-engine command only looks for az in some pre-defined set of locations? az location is added to the $PATH on my machine so it can be invoked from terminal.
I'm experiencing the same issue.
$ zsh --version
zsh 5.5.1 (x86_64-apple-darwin17.5.0)
$ which az
/Users/martinffx/bin/az
$ aks-engine version
Version: v0.33.3
GitCommit: 395ef242f
GitTreeState: clean
So I found the place where this is failing... It's actually not part of the aks-engine code it's part of one of the vendor directories: https://github.com/Azure/aks-engine/blob/master/vendor/github.com/Azure/go-autorest/autorest/azure/cli/token.go#L121
FWIW, this config works for me:
zsh --version && which az && az --version ✔ 3799 18:42:00
zsh 5.6.2 (x86_64-apple-darwin17.7.0)
/usr/local/bin/az
azure-cli (2.0.49)
I've tried to align my environment as close as possible with yours but I still getting the same issue.
$ zsh --version && which az && az --version
zsh 5.7.1 (x86_64-apple-darwin18.2.0)
/usr/local/bin/az
azure-cli 2.0.61
getting this on wsl ubuntu as well
INFO[0000] new api model file has been generated during merge: /tmp/mergedApiModel144878442 DEBU[0000] Resolving tenantID for subscriptionID: *** Error: loading API model: failed to get client: Invoking Azure CLI failed with the following error:
No error is displayed. This should be investigated.
In case you are running it inside the linux container and it errors out at Invoking CLI, the solution is to change the authentication method to client_secret rather than CLI
--auth-method client_secret
Hi there... I had the same issue... resolved run the command with "sudo" ;)
Running into the same problem here on latest aks-engine and azure cli -- using sudo aks-engine ... works, but is no permanent solution.
@ahoereth are you using --auth-method client_secret as Munish pointed out?
No, but I am also running locally on macos, not inside a docker container. The goal is to use cli as auth method and it worked previously. Works using sudo.
In that case you should use --auth-method cli. The device auth-method which was previously default was deprecated a while ago and replaced by client-secret as default.
We still need to investigate why no error is returned before getting to this step if the auth doesn't work.
I am using --auth-method cli -- same problem.
aks-engine deploy --auth-method cli --subscription-id ... --resource-group ... --dns-prefix ... --location northeurope --debug --api-model aks.json --force-overwrite```
And you are logged into az cli? I assume you ran az login before running aks-engine deploy?
Jup, ran az login fine before running aks-engine deploy. If I use sudo aks-engine deploy instead it works. If I do not use sudo I get the error stated above: " failed to load apimodel: failed to get client: Invoking Azure CLI failed with the following error: /bin/zsh: can't open input file: az"