azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

linux error: az CLI command not found

Open rhavenn opened this issue 3 years ago • 2 comments

Debian 11 (Bullseye) running in WSL2 (Win 11). core tools were installed with NPM and the az CLI via the MS azure-cli DEB package.

any command that involves talking to azure just fails with:

func azure functionapp list-functions helloworld
Unable to connect to Azure. Make sure you have the `az` CLI or `Az.Accounts` PowerShell module installed and logged in and try again`

which az shows: /usr/bin/az whereis az shows: az: /usr/bin/az /opt/az/bin/az.bat /opt/az/bin/az

func --version : 4.0.3971 az --version : azure-cli 2.33.1

rhavenn avatar Feb 24 '22 00:02 rhavenn

@rhavenn , are you logged into your Azure subscription? Could you try running az account show --output table and let us know if anything shows up?

michaelpeng36 avatar Feb 24 '22 18:02 michaelpeng36

I had not / was not logged in. I was assuming it would have prompted me to do that vs saying "cannot find path to az". after logging in I now get a "unable to find project root" error, but that's a different matter.

I would, personally, suggest a different error output if you're not logged in vs. the az command is not in fact truly found.

Appreciate the help.

rhavenn avatar Feb 24 '22 19:02 rhavenn