The first thing to needed to begin working Azure account from PowerShell is to install PowerShell (if requried) and connect your Azure subscription to your machine. The process is pretty straight forward and is fully described in the Microsoft article How to install and configure Azure PowerShell. I just downloaded the Microsoft Web Platform Installer as instructed and added the Azure tools. I then opened up the Azure PowerShell console and typed in
PS C:\> Add-AzureAccount
Which prompted me to log in:
Sign in to Windows Azure prompt window |
PS C:\> Select-AzureSubscription <subscription name>
which is really cool if all of your subscriptions have different names! I had a couple that were the same, both MSDN account related: one for work and one for my side business. Luckily, someone had already asked the question on StackOverflow and the answer was simply to rename the accounts (link).
Edit: Interesting! The issue that I was complaining about above was based on the assumption that once the account was connected to a machine, it would stay. That isn't the case! Using the method above to associate an Azure account with a session will expire:
Edit: Interesting! The issue that I was complaining about above was based on the assumption that once the account was connected to a machine, it would stay. That isn't the case! Using the method above to associate an Azure account with a session will expire:
Your Windows Azure credential in the Windows PowerShell session has expired. |