Windows Azure powershell – First steps

I used the Microsoft cloud platform since few months for personnal use, mainly as a lab to test and build powershell scripts.

This article will (i hope) provide you concret scripts and technical references to build a lab from scratch in just few minutes.

First of all, keep in mind that Azure it’s not free, but Microsoft will give you one month trial. So, if you want a lab for free, during a long time: just create an email account as needed 🙂

Module Installation

Ok, as your account is configured, it’s time to download the Windows Azure PowerShell module. To acheive this fastidious task, download Web Platform Installer and follow steps besides.

Azure1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ok, as we wan to use PowerShell module, just clik on Add in front of Windows Azure PowerShell, and then click Install at the bottom.

 

Azure2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

On this screen, click on Accept. The following window will print the advancement of the module and all his dependencies.

Azure3

 

 

 

 

 

 

 

 

 

 

 

 

You should in the end, see something like this…

 

Azure4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

To load the Azure module (Windows 7 x64)

Import-Module 'c:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\Azure.psd1'

And now we have 273 new cmdlets to work with !

(Get-Command -Module Azure).count

 

Authentication

 

To finish this first article about Microsoft Azure, i will present the two methods to authenticate with your account on the platform.

 

Certificate method

 

Once logged into your account, use the following cmdlet to download the subscription information, and register it in your favorite place !

 Get-AzurePublishSettingsFile

Now, we’ll import this setting file into our PowerShell session

 Import-AzurePublishSettingsFile 'C:\Temp\Free Trial-2-25-2014-credentials.publishsettings'

 

Manual method

 

This method will perform a manual action to log you for 6 hours and execute actions on your account.

Add-AzureAccount

Once executed, this cmdlet will load a Web Window asking for authentication

Azure5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Once logged, it’s done.

 

Information about your account

 

To gather informations about your account, use the following command

Get-AzureAccount

Azure6

 

 

 

 

Get-AzureSubscription

Azure7

 

 

 

 

 

 

 

 

 

 

 

As you can see the property CurrenStorageAccountName is empty ! This will be the subject of a next post about Windows Azure in this blog.

Regards

 

Tags: