getsops/sops

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

Closed this issue · 9 comments

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

Same issue here. az installed and in the PATH.

4x0v7 commented

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

Yep I did

4x0v7 commented

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

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

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

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

Upgrading sops to 3.8.0 fixed this for me