Losing your “ARM” “AZ” you move forward with Azure PowerShell

//Losing your “ARM” “AZ” you move forward with Azure PowerShell

For any of us that have interacted with Microsoft Azure for any length of time, we know that at times there are actions or resources that are not fully configurable from the Azure Portal.  When times like this occur one way to handle this is to jump to the Azure PowerShell modules to make these changes.

In the past this meant firing up PowerShell and pulling down the latest Azure and AzureRM cmdlets.  You may ask why would you need both Azure and AzureRM?  The Azure cmdlets targeted the classic resources that still lingered about in the Azure cloud, while the AzureRM cmdlets targeted the new Azure Resource Manager resources.  There were transition periods of Microsoft Azure that necessitated having both sets of PowerShell cmdlets.  While this Azure transition was taking place, there was another transition that was also taking place.  PowerShell went from a Windows only powerful scripting language to an open source cross platform implementation.  This means that PowerShell was now available to be run on Windows, Linux and MacOS.

During this transition period for PowerShell it was also an opportunity for the team that managed the Azure cmdlets to update them as well and thankfully around December of 2018 they released the new Azure AZ module. The beauty of these new cmdlets is that they offer shorter commands, improved stability and cross-platform support.

This means that a command that used to be New-AzureRMVM is now simply New-AzVM.

https://docs.microsoft.com/en-us/powershell/azure/new-azureps-module-az?view=azps-1.0.0

It is now the recommendation of Microsoft that all users upgrade to the new Azure Az module.

The steps involved in doing so are as follows:

I have worked with many clients that in addition to Azure ARM Templates, have extensive Azure PowerShell scripts that provision things like virtual networks and include embedded network security groups.  When I first started to read about the new Az modules, I wondered how these “legacy” scripts would be affected by the new modules.

Thankfully the team that wrote the modules thought of this and implemented a very cool feature.  The new Azure AZ module has a switch called Enable-AzureRMAlias.  This allows the new Az cmdlets to respond to commands that still use the older AzureRM naming conventions.  In this way, organizations will have time to go through their current Azure PowerShell scripts and update them to the new naming standard.  Once all scripts are updated you simply call the Disable-AzureRMAlias switch.

As you transition to the new Azure AZ Module, if you run into any questions, feel free to reach out to us here at Nebbia and we will be more than happy to assist.

By |2019-01-16T10:44:03+00:00January 16th, 2019|

About the Author:

Jeff is an Azure Cloud / Dev Ops Consultant with notable success directing a broad range of IT initiatives while participating in planning and implementation of cloud first solutions. He has a proven track record of increasing responsibility in production support, systems analysis and design and has worked in large organizations such as Raymond James Financial, American Express and Bloomin Brands. Jeff also leads the Tampa PowerShell User Group and actively blogs at Scriptwarrior.wordpress.com and can be reached on Twitter @ScriptWarrior.