Getting Started with Azure Powershell


1/14/2015 update:

Microsoft has made this even easier. Here’s a high level overview of the steps to take to use Azure with Powershell:

  • To start you need an Azure Subscription. You can sign up for a free subscription here.
  • Install Azure DSK from the Web Platform Installer.
  • Run Powershell command (to login in the pop-up windows to your Azure account): Add-AzureAccount
  • Run Powershell command (and download publish settings file from the browser that will pop-up): Get-AzurePublishSettingsFile
  • Run Powershell command: Import-AzurePublishSettingsFile ‘C:\Path-to-my\file-credentials.publishsettings’

Veeam-Azure09

Veeam-Azure10

Veeam-Azure11


Get an Azure Subscription

To start you need an Azure Subscription. You can sign up for a free subscription here.

Install Azure SDK

I’m testing on Windows 8.1 and Server 2012 R2 machines.

Next install Azure DSK from the Web Platform Installer.

Az01

After installation, type in Azure in the search field, click the search icon, then click Install to see installed modules on top:

Az02

Get Azure publish settings

Open Powershell ISE, and run the cmdlets:

Import-module "C:\Program Files (x86)\Microsoft SDKs\Azure\
PowerShell\ServiceManagement\Azure"
$AzureLogin = "myaccount@mydomain.com"
Remove-AzureAccount -Name $AzureLogin -Confirm:$false -Force
Get-AzureAccount -Name $AzureLogin
Get-AzurePublishSettingsFile

azure-powershell-getting-started-05

Save it to c:\temp\MyAccount-12-10-2014-credentials.publishsettings for example

Run the Powershell cmdlet

Import-AzurePublishSettingsFile c:\temp\MyAccount-12-10-2014-credentials.publishsettings

Test settings

That’s it. To test access to your account runs Powershell cmdlets against it like

Get-AzureSubscription

or

Get-AzureStorageAccount

To see Azure cmdlets from the Azure PS module, run:

Get-Command *Azure*

I’m counting 443 cmdlets! (Azure PS module version 0.8.11 tested December 11, 2014)

Advertisements

3 responses

  1. Pingback: Creating new Azure Storage Account using Powershell | Sam's Corner

  2. Pingback: Powershell function/tool to set/update Azure VM Endpoint Access Control List | Sam's Corner

  3. Pingback: Powershell script to monitor and protect Azure VM against Denial of Service attacks | Sam's Corner

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