Get started with Azure PowerShell

For this to work, you need to have an existing subscription with Microsoft Azure. You can also register for free trial worth 200$ or you can outright purchase Azure.

You can run the cmdlets from the standard Windows PowerShell console, or from PowerShell Integrated Scripting Environment (ISE). First command you type is to login to get authenticated with Azure services.

If you need to login into Azure classic portal, you can use cmdlet Login-AzureAccount to start with. If you are logging into new Azure resource manager portal, you need to use Login-AzureRMAccount to login. Depending upon your subscription and account type, this may present a pop-up window where you can type your credentials to login. Once it completes, it will save your credentials for session.

You can have multiple accounts and subscriptions available for use by Azure PowerShell. You can add multiple accounts by running Add-AzureRmAccount more than once. To display the available Azure accounts, type Get-AzureAccount. To display your Azure subscriptions, type Get-AzureRmSubscription.

The Switch-AzureMode cmdlet switches between the Azure and Azure Resource Manager (AzureResourceManager) modules.

Parameter Set:

Switch-AzureMode [-Name] <AzureModule> [-Global] [ <CommonParameters>]

However, starting with v0.9 or greater (which should be default download now as of today), above cmdlet stands deprecated. If you have been through my earlier post, you can see that we installed v1.0 and above for all 3 modules.

For reference information about the cmdlets, see Azure Cmdlet Reference.
For sample scripts and instructions to help you learn to use scripting to manage Azure, see the Script Center.

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s