Switch-AzureMode

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Switch-AzureMode

Switches between the Azure and Azure Resource Manager modules

Syntax

Parameter Set: Default
Switch-AzureMode [-Name] <AzureModule> [-Global] [ <CommonParameters>]

Detailed Description

The Switch-AzureMode cmdlet switches between the Azure and Azure Resource Manager (AzureResourceManager) modules. These modules are not designed to be used in the same session. To determine which module is in your current session, use the Get-Module cmdlet.

NOTE: The AzureResourceManager module is currently in preview. It might not provide the same management capabilities as the Azure module.

Beginning in version 0.8,0, the Azure PowerShell installation includes both Azure modules and Azure Profile, a module of commands common to both modules. When you use the Azure PowerShell cmdlets, the Azure and Azure Profile modules are imported into the session by default. To remove the Azure module from the session and import the Azure Resource Manager module, use Switch-AzureMode. And, to switch back to the Azure module, just use Switch-AzureMode again.

The Azure module includes cmdlets that help you to manage your Azure account in the traditional way. The cmdlets get, create, change, and remove individual resources such as storage accounts, virtual machines, SQL databases, web sites, media services, and cloud services.

The new Azure Resource Manager module, introduced in Azure PowerShell version 0.8.0, lets you manage your resources in an entirely new way. Instead of creating individual resources and trying to use them together, begin by imagining the service you want to create, such as a web portal, a blog, a photo gallery, a commerce site, or a wiki. Select a resource group template, including one of dozens in the Azure template gallery, or create your own. Each template provides a model of a complex service, complete with the resources that you need to support the service. Then use the template to create a resource group and its resources, and deploy and manage the related resources as a unit.

You can use Switch-AzureMode to switch between Azure modules as often as you like. To set an Azure module as the default for all sessions, use the Global parameter when switching between modes.

Parameters

-Global

Switches all Windows PowerShell session to the specified Azure module. Use this parameter to save your module selection for other sessions. This parameter is optional. By default, the switch affects only the current session.

Aliases

none

Required?

false

Position?

named

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

-Name<AzureModule>

Switches to the specified module. To switch to the Azure Resource Manager module, type AzureResourceManager. To switch to the Azure module, type AzureServiceManagement. This parameter is required.

Aliases

none

Required?

true

Position?

1

Default Value

none

Accept Pipeline Input?

false

Accept Wildcard Characters?

false

<CommonParameters>

This cmdlet supports the common parameters: -Verbose, -Debug, -ErrorAction, -ErrorVariable, -OutBuffer, and -OutVariable. For more information, see  about_CommonParameters (https://go.microsoft.com/fwlink/p/?LinkID=113216).

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None

    You cannot pipe input to this cmdlet.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • None

    This cmdlet does not generate any output.

Notes

  • Switch-AzureMode is introduced in version 0.8.0 of the Azure modules. To get the version of your module, type: (Get-Module <ModuleName>).Version

  • The Switch-AzureMode cmdlet is exported by the AzureProfile module. The AzureProfile module is compatible with both the Azure and Azure Resource Manager modules and is imported automatically whenever either module is imported.

Examples

Example 1: Switch to the Azure Resource Manager module

This command shows you how to switch between modules. The first command uses the Switch-AzureMode cmdlet to switch to the Azure Resource Manager module. The second command uses the Switch-AzureMode cmdlet to switch back to the Azure module.

When you import either module, the AzureProfile module, which includes commands common to both modules, including Add-AzureAccount, Get-AzureSubscription, and Switch-AzureMode, is imported, too.

PS C:\> Switch-AzureMode -Name AzureResourceManager
PS C:\>Switch-AzureMode -Name AzureServiceManagement

Example 2: Switch all sessions to the Azure Resource Manager module

This command uses the Global parameter of Switch-AzureMode to switch all Windows Azure PowerShell sessions to the Azure Resource Manager module. If you close this session and open an new one, the Azure Resource Manager module is imported by default.

PS C:\> Switch-AzureMode -Name AzureResourceManager -Global