Install Windows Azure PowerShell Cmdlets Step-By-Step Connect to Windows Azure Includes Importing MSOnlineBackup Module


Thought Leadership & Events

There are two ways you can authenticate to Windows Azure.  You can store a username and password or you can use a certificate.  If you want to authenticate with a password see How to: Connect to your subscription My preference is to use a certificate. 

Certificate Authentication

The Windows Azure PowerShell module includes cmdlets that help you download and import the certificate.

  • 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.

  • The Import-AzurePublishSettingsFile imports the .publishsettings file for use by the module. This file includes a management certificate that has security credentials.

Important  We recommend that you delete the publishing profile that you downloaded using Get-AzurePublishSettingsFile after you import those settings. Because the management certificate includes security credentials, it should not be accessed by unauthorized users. If you need information about your subscriptions, you can get it from the Windows Azure Management Portal or the Microsoft Online Services Customer Portal.

  1. Sign in to the Windows Azure Management Portal using the credentials for your Windows Azure account.

  2. Download and install the Windows Azure PowerShell Tools. Several components will be installed, you can take the defaults, accept the license agreement and let it go. Once done, click Finish.  The Web Platform Installer will remain open allowing you to install additional components.  You do not need any of them.  Just click Exit

  3. Open the Windows Azure PowerShell console: On a computer running at least Windows 8 or Windows Server 2012, you can use the built-in Search. From the Start screen, begin typing power. This produces a scoped list of apps that includes Windows PowerShell and once installed, Windows Azure PowerShell. Click Windows Azure PowerShell to open the console window. (To pin the app to the Start screen, right-click the icon then select pin to start.)

  4. Type the following command:

    Get-AzurePublishSettingsFile

  5. When prompted, download and save the publishing profile and note the path and name of the .publishsettings file. This information is required when you run the Import-AzurePublishSettingsFile cmdlet to import the settings. The default location and file name format is:

    C:Users<UserProfile>Downloads[MySubscription-…]-downloadDate-credentials.publishsettings

  6. Type a command similar to the following, substituting your Windows account name and the path and file name for the placholders:

    Import-AzurePublishSettingsFile C:Users<UserProfile>Downloads[MySubscription-…]-downloadDate-credentials.publishsettings

    Example:

    Import-AzurePublishSettingsFile C:UsersCampAdminDownloadsBizSpark-Pay-As-You-Go-1-28-2014-credentials.publishsettings
     image

  7. Delete the .pushlishsettings file it is no longer needed and should not be left around to get compromised.

  8. If you have multiple accounts you can simply login to Windows Azure with the other account credentials (step 1 above) then repeat steps 4-7 for the other accounts.

Note: If you are added to other subscriptions as a co-administrator after you import your publish settings, you’ll need to repeat this process to download a new .publishsettings file, and then import those settings. For information about adding co-administrators to help manage services for a subscription, see Add and Remove Co-Administrators for Your Windows Azure Subscriptions.

 

Other Modules (Online Backup MSOnlineBackup) Windows Azure Backup

If you want to use other modules within Windows Azure you have to import them.  To Import the Online Backup modules for example, install Windows Azure Backup Agent then run:

      Import-module MSOnlineBackup

NOTE:  If you get an error importing the module from the Windows Azure PowerShell windows, try importing into the regular PowerShell window.  You can still get to Azure and OB modules from ISE.

To use the Online Backup (OB) cmdlets, you must be a member of the Administrators group or the Backup Operators group. You can view the list of available cmdlets by using the following cmdlet:

      get-command -module MSOnlineBackup  

To get the online Help for the cmdlet, download the Help files by using the following cmdlet:

You can view additional information about a specific cmdlet by using the following cmdlet and specifying the cmdlet name:

     Get-Help -cmdletname

See Windows and Windows Server Automation with Windows PowerShell for more modules

View account and subscription details

You can have multiple accounts and subscriptions available for use by Windows Azure PowerShell. 

To see the available accounts, type:

To see subscription information, type:

 

For help from the community, try these popular forums:

Additional Resources

These are some of the resources available that you can use to learn to use Windows Azure and Windows PowerShell.