We are pleased to introduce Azure PowerShell 1.0 Preview, now available on PowerShell Gallery and will be available on WebPI in upcoming weeks. There are many changes in this preview and Micosoft would like to use it to gather feedback, which they’ll incorporate into Azure PowerShell 1.0.

Note: This is a preview and not intended for mission critical applications. If you are running such applications, please continue to use Azure PowerShell 0.9.8. If you would like to use 1.0 Preview, you can uninstall at any point and go back to 0.9.8 (see uninstall section below).

The Azure PowerShell team is laying the foundation for the future of Azure PowerShell with the release of 1.0 Preview. The goals of Azure PowerShell 1.0 are the following:

  • Enable better support for Resource Manager in Azure Automation
  • Separate Azure Service Management and Resource Manager functionality to provide clarity regarding features of Azure the cmdlets target
  • Enforce semantic versioning and ensure cmdlets authored against a given major version of Azure PowerShell will not encounter breaking changes from updates to Azure PowerShell
  • Distribute Azure PowerShell through WebPI and PowerShell Gallery to enable quicker delivery of new features and defect resolutions
  • Automation of Azure PowerShell MSDN reference documentation

Note: This is a breaking change for customers using the Azure Resource Manager cmdlets since these cmdlets now get prefixed with AzureRM. To ease the transition, customers can uninstall 1.0 Preview and reinstall 0.9.8 (see uninstall section below).

Getting started is easy!

Set-ExecutionPolicy RemoteSigned
Install-Module AzureRM
Install-AzureRM
LoginAzureRmAccount

For a more in depth explanation of install, usage and uninstall continue with the rest of the post.

Installing and importing Azure PowerShell 1.0 Preview

Note: Installing Azure PowerShell 1.0 Preview using PowerShellGet requires Windows Management Framework 5.0(Windows 10 includes this by default).

To install Azure PowerShell 1.0 Preview with PowerShellGet, run the following commands:

# Install the Azure Resource Manager modules from PowerShell Gallery
Install-Module AzureRM
Install-AzureRM
# Install the Azure Service Management module from PowerShell Gallery
Install-Module Azure

Now that Azure PowerShell 1.0 preview has been installed, you can import the Azure and AzureRM modules. Azure Resource Manager is split into component modules. For example, Azure Resource Management modules for compute services are in module AzureRM.Compute.

 

# Import all of the AzureRM.* modules within the known semantic version range
Import-AzureRM
# Import a single AzureRM module
Import-Module AzureRM.Compute
# Import Azure Service Management
Import-Module Azure

Now that the modules have been imported into the current PowerShell session, Azure PowerShell cmdlets are loaded.

Getting started with Resource Manager

# To login to Azure Resource Manager
LoginAzureRmAccount
# To view all subscriptions for your account
Get-AzureRmSubscription
# To select a default subscription for your current session
Get-AzureRmSubscription –SubscriptionName “your sub” | Select-AzureRmSubscription
# To select the default storage context for your current session
Set-AzureRmCurrentStorageAccount –ResourceGroupName “your resource group” –StorageAccountName “your storage account name”
# To import the Azure.Storage data plane module (blob, queue, table)
Import-Module Azure.Storage
# To list all of the blobs in all of your containers in all of your accounts
Get-AzureRmStorageAccount | Get-AzureStorageContainer | Get-AzureStorageBlob

All of the Azure Resource Manager cmdlets follow the [Verb]-AzureRm[Noun] pattern to provide clear indication they work with Azure Resource Manager rather than Azure Service Management.

Getting started with Service Management

Service management should encounter no breaking changes as a result of the separation of Azure Service Management and Azure Resource Manager in Azure PowerShell 1.0 preview. To illustrate this, the commands below should look very familiar.

# Import the Azure Service Management module
Import-Module Azure
# To login to Azure Service Management
Add-AzureAccount
# To list the your virtual machines
Get-AzureVM

Uninstalling

# Uninstall the AzureRM component modules
Uninstall-AzureRM
# Uninstall AzureRM module
Uninstall-Module AzureRM
# Uninstall the Azure module
Uninstall-Module Azure

Changes to Azure Resource Manager Cmdlets

There are some major improvements and changes to the management cmdlets in Azure Resource Manager. You can view all the changes here.

Again, Getting started is easy!

Set-ExecutionPolicy RemoteSigned
Install-Module AzureRM
Install-AzureRM
LoginAzureRmAccount

What’s Coming Next?

The process of building Azure PowerShell 1.0 preview was greatly influenced by the MS community of MVPs, open source contributors and customers. They believe this influence and public discussion led us to a better solution, not just for the team building Azure PowerShell, but for all of the people that use Azure PowerShell. Let’s keep the feedback coming via GitHub and create an even better Azure PowerShell 1.0.

Expect to see an MSI and a WebPI installer in the upcoming weeks or days. MS’ll also be adding some more blog posts to explaining some of the design decision, the great open source story of the deprecation of Switch-AzureMode, and more about how to leverage Azure PowerShell 1.0.