Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'az' is not recognized as an internal or external command #818

Closed
Alxandr opened this issue Feb 18, 2021 · 9 comments
Closed

'az' is not recognized as an internal or external command #818

Alxandr opened this issue Feb 18, 2021 · 9 comments

Comments

@Alxandr
Copy link

Alxandr commented Feb 18, 2021

I'm trying to authenticate using the az CLI, and this is the result:

[CMD]    time="2021-02-18T16:03:13+01:00" level=debug msg="Master keys available:  [0xc0000e1f80]"
[AZKV]   time="2021-02-18T16:03:13+01:00" level=error msg="Failed to create Azure authorizer" error="Invoking Azure CLI failed with the following error: 'az' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
Error encrypting the data key with one or more master keys: [failed to encrypt new data key with master key "https://policyeditdevsecrets.vault.azure.net/keys/sops-key/b06996d06c7f4c6fa4849c5fd89b6c5c": Invoking Azure CLI failed with the following error: 'az' is not recognized as an internal or external command,
operable program or batch file.
]

This doesn't make sense though, cause az is both installed an in PATH (as can be seen bellow):

image

@rindeastwood
Copy link

Same issue here. az installed and in the PATH.

@4x0v7
Copy link

4x0v7 commented Feb 26, 2021

Same here. Did you scoop install azure-cli ? I wonder if that could be the issue

@Alxandr
Copy link
Author

Alxandr commented Feb 26, 2021

Yep I did

@4x0v7
Copy link

4x0v7 commented Mar 2, 2021

As a test, I did a scoop uninstall azure-cli and then just installed the Windows MSI. The error went away.

This leads me to believe the issue is with how scoop is setting up the shim for az

@Alxandr
Copy link
Author

Alxandr commented Mar 2, 2021

I agree that's likely the root of the issue here, but I would claim that the issue is how sops is trying to find az, and concludes it doesn't exist

@autrilla
Copy link
Contributor

autrilla commented Mar 2, 2021

It's not SOPS, it's the Azure SDK.

@Alxandr
Copy link
Author

Alxandr commented Mar 2, 2021

Ah, then this issue just needs to be opened in another repo. Which SDK is this?

@felixfontein
Copy link
Contributor

The code which reports the error seems to be this one: https://github.com/Azure/go-autorest/blob/master/autorest/azure/cli/token.go#L165

@mikeblakeuk
Copy link

Upgrading sops to 3.8.0 fixed this for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants