Latest Azure PowerShell version 0.8.0 has a preview module included

In my previous blog I mention the latest version has two module.  Well, I was wrong!  It’s important that you take the time to read the documentation and pay attention to what’s trending in the social network (such as twitter).  I did notice someone tweet about the new Azure module included in this last released: the “AzureResourceManager“.  And here’s where the fun begin.

There are three modules:

  1. Azure
  2. AzureProfile
  3. AzureResourceManager (Preview)

When executing the “Get-Module -ListAvailable” command you will notice that only 2 will show up: Azure and AzureProfile.

Azure_GetModule_02

This new module is a “PREVIEW“, and the documentation states “The Azure and Azure Resource Management modules are not designed to be used in the same Windows PowerShell session. To make it easy to switch between them, we have added a new cmdlet, Switch-AzureMode.”  Here’s the link to the documentation: http://msdn.microsoft.com/en-us/library/jj554330.aspx

This means that in order to use the new commands from the “AzureResourceManager” you need to run the “Switch-AzureMode” which will prevent you from using the Azure commands such as Get-AzureVM on the same PowerShell session.  Now, keep in mind that you can always open another session to keep working with the Azure module commands.

PowerShell with module Autoload On
PowerShell with module Autoload On

At the same time, If you need to use the command “Import-Module Azure“, you’ll notice that it will give an error telling that it can’t find the module. The trick here is, if you haven’t turned off the PowerShell Module Autoload option, the commands will be available.  Here’s a TechNet link on how to Turn-Off the PowerShell Autoload module (not recommended): http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/20/powertip-turn-off-powershell-module-autoload.aspx

Import-Module Azure Error
Import-Module Azure Error

This is a bug that have been recently reported to the Microsoft Azure PowerShell team.  By default, PowerShell have the Module Autoload “ON” and you will be able to list all the Azure module commands.

PowerShell Autoload Azure commands
PowerShell Autoload Azure commands

So, you can still work with your Azure PowerShell commands and use the “Switch-AzureMode” on another session.

Use the "Switch-AzureMode" to preview the new AzureResourceManager cmdlets

Now you can continue to work with PowerShell Azure command and check out is new (Preview) module AzureResourceManager.

List of the Preview Module AzureResourceManager Cmdlets:Azure_ListPreview_06

Get-AzureLocation
Get-AzureResource
Get-AzureResourceGroup
Get-AzureResourceGroupDeployment
Get-AzureResourceGroupGalleryTemplate
Get-AzureResourceGroupLog
New-AzureResource
New-AzureResourceGroup
New-AzureResourceGroupDeployment
Remove-AzureResource
Remove-AzureResourceGroup
Save-AzureResourceGroupGalleryTemplate
Set-AzureResource
Stop-AzureResourceGroupDeployment
Test-AzureResourceGroupTemplate

Happy PowerShelling!

Problem installing the latest Azure PowerShell Cmdlets with WMF v5.0 Preview

If you’re experiencing problems installing the latest Azure PowerShell cmdlets (0.8.0 – 04/03/2014)  after installing Windows Management Framework v5.0 Preview (WMF) then don’t worry.

You can go back the uninstall the WMF v5.0 Preview, then proceed to download/install the recent *Azure PowerShell cmdlets, and go back to re-install the WMF v5.0 Preview.  It will back be working like nothing happened.

Azure_WMF5_01

Looks like there are two Azure modules in this update:

  1. Azure
  2. AzureProfile

*Note: I’m this steps may need to be repeated until WMF v5.0 becomes RTM.

Azure_WMF5_02

🙂