Azure/azure-powershell


Microsoft Azure PowerShell

License: Other

Language: C#

Keywords: arm, azure, microsoft, microsoft-azure-powershell, powershell


# Microsoft Azure PowerShell

This repository contains a set of PowerShell cmdlets for developers and administrators to develop, deploy and manage Microsoft Azure applications.

Features

  • Account management

    • Login with Microsoft account, Organizational account, or Service Principal through Microsoft Azure Active Directory
    • Save Credentials to disk with Save-AzureRmProfile and load saved credentials using Select-AzureRmProfile
  • Environment

    • Get the different out-of-box Microsoft Azure environments
    • Add/Set/Remove customized environments (like your Azure Stack or Windows Azure Pack environments)
  • Management and data plane cmdlets for Azure services in ARM and RDFE

    • VM
    • Storage
    • Network
    • App Service (Websites)
    • SQL Database
    • KeyVault
    • Data Lake Store
    • Data Lake Analytics
    • Operational Insights
    • Automation
    • Batch
    • Backup
    • RecoveryServices and SiteRecovery
    • Stream Analytics
    • Traffic Manager
    • DataFactories
    • DNS
    • HDInsight
    • Express Route
    • Scheduler
    • StorSimple
    • Redis Cache
  • Windows Azure Pack

    • Web Site: CRUD web site, deployment, configure and get log, start/stop/restart/show web site
    • Service Bus: CRD namespace
    • VM: CRUD VM, get OS disk, size profile and VM template, start/stop/restart/suspend/resume VM
    • VNET: CRUD VNET and subnet.
    • Cloud Service: CRUD cloud service.
  • Windows Azure Stack

    • Azure Stack Administration
    • Storage Service Management

For detail descriptions and examples of the cmdlets, type

  • help azure to get all the cmdlets.
  • help azurerm to get all the Azure Resource Manager (ARM) cmdlets.
  • help <cmdlet name> to get the details of a specific cmdlet.

Supported Environments

Installation

Microsoft Web Platform Installer

  1. Install Microsoft Web Platform Installer.
  2. Open Microsoft Web Platform Installer and search for Microsoft Azure PowerShell.
  3. Install.

You can also find the standalone installers for all the versions at Downloads

PowerShell Gallery

  1. Install Windows Management Framework 5 with PowerShellGet cmdlets
  2. In an elevated PowerShell session, run Install-Module AzureRM
  3. Run Install-AzureRm
  4. To install RDFE cmdlets, run Install-Module Azure

Source Code

  1. Download the source code from GitHub repo
  2. Follow the Azure PowerShell Developer Guide

Supported PowerShell Versions

Get Started

In general, follow these steps to start using Microsoft Azure PowerShell

  • Get yourself authenticated with Microsoft Azure. For details, please check out this article.
    • Option 1: Login with your Microsoft account or Organizational account directly from PowerShell. Microsoft Azure Active Directory authentication is used in this case. No management certificate is needed.
      • Starting from 1.0.0, you can use Add-AzureRmAccount -Credential to avoid the browser pop up for Organizational account.
      • To use RDFE cmdlets, use Add-AzureAccount
  • Use the cmdlets

The first step can be different for different environment you are targeting. Following are detail instructions for each supported environment.

Microsoft Azure

If you use both mechanisms on the same subscription, Microsoft Azure Active Directory authentication always wins. If you want to go back to management certificate authentication, please use Remove-AzureAccount, which will remove the Microsoft Azure Active Directory information and bring management certificate authentication back in.

Login directly from PowerShell (Microsoft Azure Active Directory authentication)

# Pop up an embedded browser control for you to login
Add-AzureRmAccount

# use the cmdlets to manage your services/applications
New-AzureRmResourceGroup -Name myresourceGroup -Location "West US"

Microsoft Azure China

Add-AzureRmAccount -EnvironmentName AzureChinaCloud

# use the cmdlets to manage your services/applications
New-AzureRmResourceGroup -Name myresourceGroup -Location "China East"

Microsoft Azure US Government

Add-AzureRmAccount -EnvironmentName AzureUSGovernment

# use the cmdlets to manage your services/applications
New-AzureRmResourceGroup -Name myresourceGroup -Location "US Gov Virginia"

Windows Azure Pack

# Add your Windows Azure Pack environment to your Microsoft Azure PowerShell installation.
# You will need to know the following information of your Windows Azure Pack environment.
# 1. URL to download the publish settings file    Mandatory
# 2. Management service endpoint                  Optional
# 3. Management Portal URL                        Optional
# 4. Storage service endpoint                     Optional
Add-WAPackEnvironment -Name "MyWAPackEnv" `
    -PublishSettingsFileUrl "URL to download the publish settings file>" `
    -ServiceEndpoint "<Management service endpoint>" `
    -ManagementPortalUrl "<Storage service endpoint>" `
    -StorageEndpoint "<Management Portal URL>"

# Download a file which contains the publish settings information of your subscription.
# Use the -Environment parameter to target your Windows Azure Pack environment.
# This will open a browser window and ask you to log in to get the file.
Get-WAPackPublishSettingsFile -Environment "MyWAPackEnv"

# Import the file you just downloaded.
# Notice that the file contains credential of your subscription so you don't want to make it public
# (like check in to source control, etc.).
Import-WAPackPublishSettingsFile "<file location>"

# Use the cmdlets to manage your services/applications
New-WAPackWebsite -Name mywebsite

Find Your Way

All the cmdlets can be put into 3 categories:

  1. ARM management cmdlets use the 'AzureRm' prefix (New-AzureRmResourceGroup, Get-AzureRmVM)
  2. Legacy RDFE management cmdlets use the 'Azure' prefix (Get-AzureVM)
  3. Data plane cmdlets that work in ARM or RDFE use the 'Azure' prefix (Get-AzureBlob)

You can use the following cmdlet to find out all the cmdlets for your environment

# Return all the cmdlets for Azure Resource Manager (ARM)
Get-Command *AzureRm*
# Return all the cmdlets for Microsoft Azure
Get-Command *Azure*

# Return all the cmdlets for Windows Azure Pack
Get-Command *WAPack*

If you want to migrate some scripts from Microsoft Azure to Windows Azure Pack or vice versa, as long as the cmdlets you are using are in category 1, you should be able to migrate smoothly.

Need Help?

Be sure to check out the Microsoft Azure Developer Forums on Stack Overflow if you have trouble with the provided code.

Contribute Code or Provide Feedback

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Azure Projects Contribution Guidelines.

If you encounter any bugs with the library please file an issue in the Issues section of the project.

Learn More


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Project Statistics

Sourcerank 7
Repository Size 1010 MB
Stars 1,496
Forks 1,555
Watchers 3,502
Open issues 685
Dependencies 2,438
Contributors 196
Tags 169
Created
Last updated
Last pushed

Top Contributors See all

Mark Cowlishaw huangpf Hovsep Samuel Anudeep Hyonho Lee vivsriaus Cormac McCarthy EmmaZhu-MSFT Abdelrahman Elogeel Denis Stankovski begoldsm deepakswifty jasper-schneider sriramvu Esha Parmar safeermohammed pragrawa mkherani pikumarmsft Raje Neha

Packages Referencing this Repo

GoCloud.Client.Powershell
[PowerShell] GoCloud Service Access
This package is no longer available on NuGet
AzureRM.Profile
Microsoft Azure PowerShell - Profile credential management cmdlets for Azure Resource Manager
This package is no longer available on NuGet

Recent Tags See all

v6.0.0-rc2 April 28, 2018
v6.0.0-RC1 April 25, 2018
testrelease2-April2018 April 23, 2018
testrelease-April2018 April 20, 2018
v0.9.0-preview-AzureRM.PolicyInsights April 10, 2018
v0.11.0-nc-April2018 April 08, 2018
v5.7.0-April2018 April 06, 2018
v5.6.0-March2018 March 23, 2018
v5.5.0-March2018 March 09, 2018
v5.4.1-February2018 February 26, 2018
v5.4.0-February2018 February 22, 2018
v5.0.0-preview-AzureRM.Websites February 22, 2018
v4.3.1-AzureRM.Compute-February2018 February 14, 2018
v0.1.0-preview-AzureRM.Compute.ManagedServiceFebaurary2018 February 14, 2018
v0.10.0-nc-February2018 February 12, 2018

Interesting Forks See all

PowerShell/azure-powershell
Microsoft Azure PowerShell
C# - Last pushed - 5 stars - 2 forks
safeermohammed/azure-powershell
Microsoft Azure PowerShell
C# - Other - Last pushed - 1 stars
jaredmoo/azure-powershell
Microsoft Azure PowerShell
C# - Last pushed - 1 stars
markcowl/azure-powershell
Microsoft Azure PowerShell
C# - Apache-2.0 - Last pushed - 1 stars - 1 forks
DamirAinullin/azure-powershell
Microsoft Azure PowerShell
C# - Last pushed - 1 stars

Something wrong with this page? Make a suggestion

Last synced: 2017-11-24 18:53:11 UTC

Login to resync this repository