Installing Azure CLI 2.0 on Windows

Azure CLI 2.0 is now in GA !

This release of Azure CLI 2.0 is the first GA release. Azure CLI 2.0 release has command updates for

  • ACS (Azure Container services)
  • Compute
  • Networking
  • Storage

The Azure CLI can be used on Linux, MacOS and Windows. While the official documentation here mentions all the steps required for installation in all supported operating systems, for windows people may face this issue when right after installation when you try to run an az command it says "az : The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program."

The issue is because the azure cli 2.0 is installed in location - C:\Users\<username>\AppData\Local\Programs\Python\Python35\Scripts\  and this path isn't added to the PATH variable. Well! until that happens here is the fix

First make sure you have python installed in your machine. If you don’t have the original CLI (or python) at all, you need that first. Download and install it from here: https://www.python.org/downloads/release/python-352/

  • Uninstall Azure CLI earlier versions with command - pip uninstall azure-cli
  • Re-install Azure CLI 2.0 - pip install --user azure-cli
  • Add the path C:\Users\<username>\AppData\Local\Programs\Python\Python35\Scripts\ to PATH variable                                                                                                                                                                                                                                    setx PATH "%PATH%;C:\Users\<username>\AppData\Local\Programs\Python\Python35\Scripts\"
  • check if the az command is working - az --help

Ideally the tool must have removed the older cli and made necessary changes in the PATHs. If it still doesn't work just drop me a comment or DM me @brijrajsingh