Skip to content
Microsoft Azure PowerShell
C# PowerShell XSLT Batchfile Smalltalk Python
Branch: master
Clone or download

Latest commit

mentat9 and wyunchi-ms Change policy cmdlets to use strongly-typed objects (#11681)
* Breaking changes for policy cmdlets to support typed pipeline objects

* Update help files to correspond to typed parameters

* Add breaking change exceptions

* Remove unneeded usings
Update changelog

Co-authored-by: Yunchi Wang <54880216+wyunchi-ms@users.noreply.github.com>
Latest commit 5278d3e Apr 26, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.azure-pipelines Add log for filtering projects to build (#11561) Apr 13, 2020
.github Update readme and issue template for docker image Jan 16, 2020
docker Correct license of PowerShell Mar 30, 2020
documentation Update private-link-resource-example.md (#11647) Apr 24, 2020
setup Version bump for release. Fix bug in VersionBumper.cs. Jan 9, 2019
src Change policy cmdlets to use strongly-typed objects (#11681) Apr 26, 2020
tools Change policy cmdlets to use strongly-typed objects (#11681) Apr 26, 2020
.dockerignore remove unused gitignore, update label in Dockerfile Jan 2, 2020
.gitattributes identified psd1, psm1, and ps1xml as text files Oct 31, 2017
.gitignore Add incorrect test case to .gitignore Mar 28, 2020
CONTRIBUTING.md Update CONTRIBUTING.md Aug 14, 2019
ChangeLog.md Merge release-2020-04-21 (#11620) Apr 17, 2020
Directory.Build.targets merge from upstream/master Dec 13, 2018
LICENSE.txt Release new KeyVault preview module (#6284) May 24, 2018
NuGet.Config merge from upstream/master Dec 13, 2018
README.md Resolve review feedback, add document for installing modules, other m… Mar 15, 2019
Repo.props Removed build folder. Moving yaml files to follow guidelines. Apr 5, 2019
appveyor.yml reverted changes to appveyor Oct 9, 2019
build.proj add property TargetModule to filter build/publish module (#11601) Apr 16, 2020

README.md

AzureIcon PowershellIcon Microsoft Azure PowerShell

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

Try it out in Azure Cloud Shell!

CloudShellIcon

Modules

Below is a table containing our Azure PowerShell rollup module.

Description Module Name PowerShell Gallery Link
Azure PowerShell Az Az

For a full list of modules found in this repository, please see the Azure PowerShell Modules document.

Installation

PowerShell Gallery

Run the following command in an elevated PowerShell session to install the rollup module for Azure PowerShell cmdlets:

Install-Module -Name Az

This module runs on Windows PowerShell with .NET Framework 4.7.2 or greater, or PowerShell Core. The Az module replaces AzureRM. You should not install Az side-by-side with AzureRM.

If you have an earlier version of the Azure PowerShell modules installed from the PowerShell Gallery and would like to update to the latest version, run the following commands in an elevated PowerShell session:

Update-Module -Name Az

Update-Module installs the new version side-by-side with previous versions. It does not uninstall the previous versions.

For detailed instructions on installing Azure PowerShell, please refer to the installation guide.

Usage

Log into Azure

To connect to Azure, use the Connect-AzAccount cmdlet:

# Device Code login - Provides a link to sign into Azure via your web browser
Connect-AzAccount

# Service Principal login - Use a previously created service principal to log in
Connect-AzAccount -ServicePrincipal -ApplicationId 'http://my-app' -Credential $PSCredential -TenantId $TenantId

To log into a specific cloud (AzureChinaCloud, AzureCloud, AzureGermanCloud, AzureUSGovernment), use the -Environment parameter:

# Specific cloud login - Logs into the Azure China cloud
Connect-AzAccount -Environment AzureChinaCloud

Getting and setting your Azure PowerShell session context

A session context persists login information across Azure PowerShell modules and PowerShell instances. To view the context you are using in the current session, which contains the subscription and tenant, use the Get-AzContext cmdlet:

# Gets the Azure PowerShell context for the current PowerShell session
Get-AzContext

# Lists all available Azure PowerShell contexts in the current PowerShell session
Get-AzContext -ListAvailable

To get the subscriptions in a tenant, use the Get-AzSubscription cmdlet:

# Get all of the Azure subscriptions in your current Azure tenant
Get-AzSubscription

# Get all of the Azure subscriptions in a specific Azure tenant
Get-AzSubscription -TenantId $TenantId

To change the subscription that you are using for your current context, use the Set-AzContext cmdlet:

# Set the Azure PowerShell context to a specific Azure subscription
Set-AzContext -Subscription $SubscriptionName -Name 'MyContext'

# Set the Azure PowerShell context using piping
Get-AzSubscription -SubscriptionName $SubscriptionName | Set-AzContext -Name 'MyContext'

For details on Azure PowerShell contexts, see our persisted credentials guide.

Discovering cmdlets

Use the Get-Command cmdlet to discover cmdlets within a specific module, or cmdlets that follow a specific search pattern:

# List all cmdlets in the Az.Accounts module
Get-Command -Module Az.Accounts

# List all cmdlets that contain VirtualNetwork
Get-Command -Name '*VirtualNetwork*'

# List all cmdlets that contain VM in the Az.Compute module
Get-Command -Module Az.Compute -Name '*VM*'

Cmdlet help and examples

To view the help content for a cmdlet, use the Get-Help cmdlet:

# View the basic help content for Get-AzSubscription
Get-Help -Name Get-AzSubscription

# View the examples for Get-AzSubscription
Get-Help -Name Get-AzSubscription -Examples

# View the full help content for Get-AzSubscription
Get-Help -Name Get-AzSubscription -Full

# View the help content for Get-AzSubscription on https://docs.microsoft.com
Get-Help -Name Get-AzSubscription -Online

For detailed instructions on using Azure PowerShell, please refer to the getting started guide.

Reporting Issues and Feedback

Issues

If you find any bugs when using the Azure PowerShell modules, please file an issue in our GitHub issues page. Please fill out the provided template with the appropriate information.

Alternatively, be sure to check out the Azure Community Support if you have issues with the cmdlets or Azure services.

Feedback

If there is a feature you would like to see in Azure PowerShell, please use the Send-Feedback cmdlet, or file an issue in our GitHub issues page to provide the Azure PowerShell team direct feedback.

Contribute Code

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

Additional information about contributing to this repository can be found in the CONTRIBUTING.md document and the Azure PowerShell Developer Guide document.

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.

You can’t perform that action at this time.