Setting up Windows Azure PowerShell

Posted on 10/17/2013 @ 5:36 AM in #Vanilla .NET by | Feedback | 1232 views

Azure is in the cloud, PowerShell is on my machine, between the two lie vast oceans and dragons.
What is a developer to do, to use PowerShell to work with Azure?

Here is what you do,

Install Windows Azure PowerShell Start WebPI, search for “Windows Azure PowerShell” – choose to add and install it.

Run Windows Azure PowerShell This is easy, click on start (or whatever the hell you do in Windows 2012), and search for Windows Azure PowerShell.

Connect your subscription 

  1. Run Get-AzurePublishSettingsFile, which will launch your browser, ask you to login, and download a .publishsettings file. Save this somewhere because you’re going to need it in the next step.
  2. Run Import-AzurePublishSettingsFile, and pass in the .publishsettings file you just downloaded. Read important note about the publish settings file.
  3. You should be all set now, run Get-AzureSubscription to verify that your susbcription is loaded.

You can now merrily run Azure commandlets.

Sometimes (quite often), you may have more than one subscription associated with your live id. In that scenario, you can use following commandlets

  1. Set-AzureSubscription commandlet to specify the default susbcription.
  2. Select-AzureSubscription commandlet to select a different one.
  3. Remove-Subscription to .. I’ll let you guess this one.

Important note about the publish settings file,

There are 2 things you should keep in mind about the publish settings file.

  1. First, delete this file soon as you have used it because it contains enough security info in it, that if I gained access to your azure subscription, I could party at your expense.
  2. Don’t get in the bad habit of downloading the publish settings file all the time. Every time you download it, it generates and stores a cert and you have a limit of 10

Sound off but keep it civil:

Older comments..