你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Get started with Azure PowerShell
Azure PowerShell is a powerful tool for managing and administering Azure resources directly from PowerShell. It's ideal for building automated workflows and managing resources using the Azure Resource Manager model. You can try it out in your browser using Azure Cloud Shell or install it locally on your machine.
This article helps you get started with Azure PowerShell and teaches its core concepts.
Install or run in Azure Cloud Shell
The easiest way to try Azure PowerShell is through Azure Cloud Shell, a browser-based environment that requires no installation. To get started, see Get started with Azure Cloud Shell. Cloud Shell runs PowerShell on a Linux container, so Windows-specific features aren't available.
When you're ready to install Azure PowerShell locally, follow the steps in How to install Azure PowerShell.
Sign in to Azure
To sign in, use the Connect-AzAccount
cmdlet. If you're using Cloud Shell, you can skip this step
since you're already authenticated for your environment, subscription, and tenant.
Connect-AzAccount
Important
Beginning in early 2025, Azure PowerShell sign-ins using Microsoft Entra ID user identities for authentication require multi-factor authentication (MFA). For more information, see Planning for mandatory multi-factor authentication for Azure and other admin portals.
For regional environments that require specific compliance (e.g., Azure China 21Vianet), use the Environment parameter:
Connect-AzAccount -Environment AzureChinaCloud
Azure PowerShell defaults to Web Account Manager (WAM) for authentication on Windows systems, while other platforms use browser-based login. For more details, see Web Account Manager (WAM).
If you have access to multiple subscriptions, you’ll be prompted to select one upon login. Learn more about this process in Login experience.
Once signed in, you can use Azure PowerShell cmdlets to manage your resources. For further details on authentication, see Sign in with Azure PowerShell.
Find commands
Azure PowerShell cmdlets follow the standard PowerShell naming convention of Verb-Noun
. The verb
describes the action (e.g., New
, Get
, Set
, Remove
), while the noun represents the resource
type (e.g., AzVM
, AzKeyVaultCertificate
, AzFirewall
, AzVirtualNetworkGateway
). Nouns in
Azure PowerShell start with the prefix Az
.
To discover commands, use the Get-Command
cmdlet. For instance, to list all commands related to
virtual machines:
Get-Command -Verb Get -Noun AzVM* -Module Az.Compute
Here’s a quick reference table of common resources and their associated modules:
Resource Type | Azure PowerShell Module | Noun Prefix |
---|---|---|
Resource Groups | Az.Resources | AzResourceGroup |
Virtual Machines | Az.Compute | AzVM |
Storage Accounts | Az.Storage | AzStorageAccount |
Key Vault | Az.KeyVault | AzKeyVault |
Web Applications | Az.Websites | AzWebApp |
SQL Databases | Az.Sql | AzSqlDatabase |
For a complete list of Azure PowerShell modules, see the Azure PowerShell modules list hosted on GitHub.
Data collection
By default, Azure PowerShell collects telemetry data to improve user experience by identifying usage
patterns and issues. No private or personal data is collected. However, you can opt-out using the
Disable-AzDataCollection
cmdlet if you prefer. For more information, see our
privacy statement.
Quickstarts and tutorials
Get hands-on with Azure PowerShell through our guided tutorials:
- Create virtual machines with Azure PowerShell
- Create a storage account
- Transfer objects to/from Azure Blob storage
- Create and retrieve secrets from Azure Key Vault
- Create an Azure SQL database and firewall
- Run a container in Azure Container Instances
- Create a Virtual Machine Scale Set
- Create a standard load balancer
Next steps
Explore more Azure PowerShell capabilities:
- Sign in with Azure PowerShell
- Manage Azure subscriptions with Azure PowerShell
- Create service principals with Azure PowerShell
For additional help, connect with the community: