Saturday, September 6, 2014

How to connect/bind an Azure subscription to Powershell



Here's how you  bind an Azure subscription to Powershell:


1. Click this link to download Azure Powershell

2. After you have installed Azure Powershell, login to the azure management portal 

3. Click this Link to Download you Azure Publishing file, save this file to a secure location as it has your management certificate and subscription information. 

4. In Azure Powershell, CD into the folder where the Publishing file was save.

Type the following command, Tip: you can use TAB key to complete the command

Import-AzurePublishSettingsFile .\[filename]


If you want to deploy Virtual Machines via powershell you must bind the default storage account. Type the following command

Get-AzureSubscription

If the currentstorage account is blank you'll need to define this.

Setting the Current Storage Account
1. From the Management portal, copy your Storage Account name (must be in the same region as your deployment)
2. Type the following Powershell


$AzSub = Get-AzureSubscription 
Set-AzureSubscription -SubscriptionName $AzSub.SubscriptionName -CurrentStorageAccountName [typenamehere]



Type Get-AzureSubscription

you should now see the CurrentStorageAccount is defined.



No comments:

Post a Comment