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 az.cmd via cmd.exe.

  1. Create a file /usr/local/bin/az
#!/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:

dos2unix /usr/local/bin/az

4. Make it executable

chmod +x /usr/local/bin/az

5. Now you can use it from Babun (Cygwin) as az [command] .



Drupal Technical Lead, Docksal creator and maintainer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store