Azure PowerShell Cmdlets
This document provides an overview and detailed descriptions of the Azure PowerShell cmdlets available for managing your Azure resources. Azure PowerShell is a set of modules that provide commands for managing Azure resources from the command line.
Getting Started
To start using Azure PowerShell cmdlets, you need to install the Azure PowerShell module. You can do this using PowerShellGet:
Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
After installation, connect to your Azure account:
Connect-AzAccount
Common Cmdlet Categories
Azure PowerShell cmdlets are organized into modules, each typically corresponding to a specific Azure service. Here are some common categories:
- Compute: Manage virtual machines, scale sets, and related resources. (e.g.,
Get-AzVM
,New-AzVM
,Stop-AzVM
) - Storage: Manage storage accounts, blobs, queues, and tables. (e.g.,
Get-AzStorageAccount
,New-AzStorageBlob
) - Networking: Manage virtual networks, subnets, IP addresses, and network security groups. (e.g.,
Get-AzVirtualNetwork
,New-AzPublicIpAddress
) - Web Apps: Manage Azure App Service web apps, functions, and deployment slots. (e.g.,
Get-AzWebApp
,New-AzWebApp
) - Databases: Manage Azure SQL Database, Cosmos DB, and other database services. (e.g.,
Get-AzSqlDatabase
,New-AzCosmosDBAccount
)
Example Usage
Here's an example of how to list all virtual machines in a specific resource group:
Get-AzVM -ResourceGroupName "MyResourceGroup"
And to create a new storage account:
New-AzStorageAccount -ResourceGroupName "MyResourceGroup" -Name "mystorageaccount" -Location "East US" -SkuName "Standard_LRS"
Finding Cmdlets
You can use the Get-Command
cmdlet to find available cmdlets. For example, to find all cmdlets related to virtual machines:
Get-Command -Module Az.Compute -Noun VM
For more detailed information on a specific cmdlet, use the Get-Help
cmdlet:
Get-Help Get-AzVM -Full