다음을 통해 공유


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

  1. Download and install Microsoft Web Platform Installer 5.0 from here. Run the app when you are ready
    [

    ](resources/3175.Installer.JPG)

  2. From the Spotlight section, add Microsoft Azure PowerShell, and then click Install

  3. Accept the license terms

  4. Wait for the installation to complete. This may take a few minutes

  5. When the installation is successfully completed, click Finish

  6. Verify that Microsoft Azure PowerShell has status Installed, and then click Exit

Configuration

  1. Click Start, type Azure, right-click on Microsoft Azure PowerShell, and choose Run as administrator

  2. In the PowerShell prompt, type Add-AzureAccount and hit Enter.

    Add-AzureAccount
    
  3. When the Sign in to Windows Azure window appears, enter the e-mail account for your Azure subscription, and then click Continue

  4. Choose if this is your Work or school account or Microsoft account

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