Features of AZ (from Microsoft)
- Az is a replacement for AzureRM and AzureRM.Netcore.
- Az runs on PowerShell 5.1 and PowerShell Core.
- Az is always up to date with the latest tooling for Azure services.
- Az ships in Cloud Shell.
- Az shortens and normalizes cmdlet names. All cmdlets use “Az” as their noun prefix.
- Az will simplify and normalize module names. Data plane and management plane cmdlets for each service will use the same Az module.
- Az ships with new cmdlets to enable script compatibility with AzureRM (Enable/Disable-AzureRmAlias).
** Note ** Before installing this new PowerShell module on a machine, make sure to either uninstall any previous AzureRM modules. Otherwise the two modules, AZ and AzureRM, will conflict with each other.
Installation
From a PowerShell 5.0+ prompt, the new module can be installed via Install-Module -Name:
During the installation process, a message about the NuGet provider may come up, simply select ‘yes’:
You may also get a message about an untrusted repository, select ‘yes’ for this as well:
Then we can wait as the module installs itself:
Once the module is installed, we can then import the module to the current PowerShell window:
If we then check with ‘Get-Module’, we’ll see that the new module is imported and available as ‘az’:
Now that the new module is installed and imported, we can review how many cmdlets are available in this new module:
Going a bit further, we can even analyze the exact number of cmdlets per submodule within this ‘AZ’ PowerShell module by using PowerShell:
$Source = (get-command |where {$_.Source -like 'AZ*'}).Count $Source |Sort-Object Source -unique Foreach ($Source in $AllSources){ $Name = $Source.Source Write-host "Cmdlets available for $Name - " -ForegroundColor White -NoNewLine $Number = (Get-Command | Where {$_.Source -eq $Name}).Count Write-host "$Number" -ForegroundColor Green }
This provides a nice outlay of cmdlets:
Performing the same task for the AzureRM module:
$Source = (get-command |where {$_.Source -like 'AzureRM*'}).Count $Source |Sort-Object Source -unique Foreach ($Source in $AllSources){ $Name = $Source.Source Write-host "Cmdlets available for $Name - " -ForegroundColor White -NoNewLine $Number = (Get-Command | Where {$_.Source -eq $Name}).Count Write-host "$Number" -ForegroundColor Green }
We then get these results:
Reviewing each submodule, we see the following additions and removals:
We can also see where cmdlet have been shifted in the submodules that are the same:
Final Thoughts
As Microsoft notes, this version is technically still in preview and the current version is 0.30 as of this writing of this post. This means that we will still be using the AzureRM module for a little while now. You will not be able to switch over to the AZ module completely, yet nor is it recommended. The ROADMAP is a place to bookmark and watch until this goes 100% live. This is a good time to educate yourself on the changes as well as prepare any scripts that you may have created for the upcoming changes.