Running Azure CLI from Babun (Cygwin)
You begin with installing the MSI provided in the instructions. However you will quickly notice, that while running
az works from the Command Prompt, it does not work from Babun (Cygwin).
The problem is that Azure CLI is a
az.cmd file. Which means it is a Windows Batch file — a script, not an executable binary. So Babun (Cygwin) will not be able to natively run it.
What you can do is you can create a Bash script to run
- Create a file
- Pu these contents inside:
#!/bin/bashcd /c/Program\ Files\ \(x86\)/Microsoft\ SDKs/Azure/CLI2/wbin
cmd.exe /c az.cmd “$@”
3. Just in case you forgot to use UNIX line endings convert them:
4. Make it executable
chmod +x /usr/local/bin/az
5. Now you can use it from Babun (Cygwin) as
az [command] .