The Azure PowerShell cmdlets are really first class if you’re wanting to manage Azure with PowerShell. However, they don’t always support the very latest Azure components and features. For example, at the time of writing this there is no Azure PowerShell module for managing Azure Container Instances.
The solution to this is to install the Nightly Build of Azure CLI 2.0. However, on Windows it is not entirely clear the easiest way to do this. So, in this post I’ll provide a PowerShell script that will:
- Install Python 3.x using Chocolatey
- Use PIP (Python package manager) to install the latest nightly build packages
- Update the Environment Path variable so that you can use Azure CLI 2.0.
Note: If you have the stable build of Azure CLI 2.0 installed using the MSI then you’ll need to configure your Environment Path variable to find the Az command that you’d like to use by default. I personally removed the stable build of Azure CLI 2.0 to make it easier.
Performing the Install
Make sure you’ve got Chocolatey installed. If you aren’t sure what Chocolatey is, it is a package management system for Windows – not unlike Apt-Get or Yum for Linux. It is free and awesome. In this process we’ll use Chocolatey to install Python for us. If you haven’t got Chocolatey installed, see this page for instructions.
Next, download and run this PowerShell script in a PowerShell Administrator Console:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You could save the content of this script into a PS1 file and then execute it like this:
It will then download and install Python, then use PIP to install the current nightly build packages. After a few minutes the installation will complete:
You can then run:
To get started.
If you’re a bit new to Azure CLI 2.0, then another great way is to use Azure CLI Interactive:
If you need to update to a newer nightly build, just run the script again and it will update your packages.
Easy as that! Now you can experiment with all the latest automation features in Azure without needing to wait for a new version of Azure CLI 2.0 or for latest Azure PowerShell cmdlets.
If you want to install even more “bleeding edge” builds (built straight off the master branch on every merge to master) then you can make a small adjustment to the script above:
On line 34 change the URL of the feed from:
Thanks for reading!