Step-By-Step: Manage Windows Azure using PowerShell
Install Windows Azure PowerShell
I installed the Windows Azure PowerShell module by running the Microsoft Web Platform Installer This is the easiest when you have an internet connection.
When prompted, click Run. The Microsoft Web Platform Installer loads, with the Windows Azure PowerShell module available for installation. The Web Platform Installer installs all dependencies for the Windows Azure PowerShell cmdlets
Connect to your subscription
The PowerShell cmdlets require your subscription information so that it can be used to manage your services. As of the .0.7 release of the module, In order to do that I downloaded the management certificate that contains the information needed to connect PowerShell to my Azure subscription.
The Windows Azure PowerShell module includes cmdlets that help you download and import the certificate. I started PowerShell from the start Screen
and used the following cmdlet to setup access.
For doing this
First install power shell as per above instruction then
PS C:> add-azureaccount
Login as azure admin account
PS C:> get-azurepublishsettingsfile
The subscription you can save it in your desktop
After save you can
PS C:> Import-AzurePublishSettingsfile “C:Users(Users folder)rDesktopPublishfile.publishsettings”
- The Get-AzurePublishSettingsFile cmdlet opens a web page on the Windows Azure Management Portal, from which you can download the subscription information. The information is contained in a .publishsettings file.
- Once saved, I used the Import-AzurePublishSettingsFile to imports the .publishsettings file for use by the module. This file includes a management certificate that has security credentials.
Import-AzurePublishSettingsFile “C:Usersadministrator.CONTOSODownloadsWindows Azure MSDN – Visual Studio Ultimate-10-29-2013-credentials.publishsettings
View account and subscription details
You can have multiple accounts and subscriptions available for use by Windows Azure PowerShell. You can add multiple accounts by running Add-AzureAccount more than once. To see the available accounts, type:
Get-AzureAccountAnd to see subscription information, type: