Visual Guide to Getting Started with Azure PowerShell
Introduction
A lot of configuration can be performed in the Azure Portal. Certain items are, however, only available with PowerShell. These can be used interactively or by using scripts. PowerShell cmdlets can be used to create, configure, remove and deploy artifacts in Azure. For repeating tasks and complex workflows this can be very time saving compared to manual configuration in the portal, not to mention ensure consistency. This guide is meant to get you started with Azure PowerShell, and is illustrated with screenshots. Basic knowledge of Azure, PowerShell and Windows is recommended.
When you have completed this guide, you will be able to run PowerShell cmdlets on your Azure subscription.
Prerequisites
- You need an Azure subscription. Here are some options for purchasing one. You can also get a one month free trial
- Download and install .NET Framework 4.5 or later. Version 4.5.2 can be downloaded here
- This guide was made with Windows 8.1 client OS
Download and install Azure PowerShell
Download and install Microsoft Web Platform Installer 5.0 from here. Run the app when you are ready
[](resources/3175.Installer.JPG)
From the Spotlight section, add Microsoft Azure PowerShell, and then click Install
Wait for the installation to complete. This may take a few minutes
When the installation is successfully completed, click Finish
Verify that Microsoft Azure PowerShell has status Installed, and then click Exit
Configuration
Click Start, type Azure, right-click on Microsoft Azure PowerShell, and choose Run as administrator
In the PowerShell prompt, type Add-AzureAccount and hit Enter.
Add-AzureAccount
When the Sign in to Windows Azure window appears, enter the e-mail account for your Azure subscription, and then click Continue
Choose if this is your Work or school account or Microsoft account
You are now ready to use Azure PowerShell with your subscription
A few cmdlets
First, use this cmdlet to get details about your account
Get-AzureAccount
Use this cmdlet to get details about your subscription. If you have more than one, you will see if this is the default and/or current one
Get-AzureSubscription
Use this cmdlet to get details about your websites
Get-AzureWebsite
These are just a few very basic cmdlets which will return information. You can explore and test the hundreds of available cmdlets on your own. Make sure you use a non-production environment for such testing. Refresh the Azure portal and see what the results are. To get you started, check out the See also section below.
Getting help
To get a list of available Azure cmdlets, type
Get-Help Azure
To get help on a specific cmdlet, type (for instance)
Get-Help Start-AzureService
Other Resources
- Microsoft Azure Portal
- Microsoft Azure General Feedback
- Microsoft Azure PowerShell Repository
- Microsoft Azure forum on MSDN
- Microsoft Azure Cmdlet Reference
- Scripting with Windows PowerShell
- Implementing Microsoft Azure Infrastructure solutions [Amazon]