Az.Powershell
Last updated
Last updated
The Az PowerShell module is a wrapper around the Azure REST API, meaning when you run a PowerShell cmdlet like Get-AzKeyVault
or Get-AzResource
, under the hood it makes authenticated HTTP calls to Azure's REST endpoints.
Each Az PowerShell cmdlet maps to a specific Azure Resource Manager (ARM) REST API endpoint, depending on the resource type and operation.
Here’s how it works:
Get-AzResource
GET https://management.azure.com/subscriptions/{subscriptionId}/resources?api-version=2021-04-01
Get-AzKeyVault
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{rg}/providers/Microsoft.KeyVault/vaults/{vaultName}?api-version=2023-02-01
New-AzRoleAssignment
PUT https://management.azure.com{scope}/providers/Microsoft.Authorization/roleAssignments/{roleAssignmentGuid}?api-version=2022-04-01
Get-AzRoleAssignment
GET https://management.azure.com{scope}/providers/Microsoft.Authorization/roleAssignments?api-version=2022-04-01
The actual version used may vary depending on the cmdlet version and installed module.
Use:
This will print HTTP request and response info to the console — including the full URI and headers.
After authenticating and connecting to your Azure account with Connect-AzAccount
, you can perform various resource management tasks in Azure. Below is a command to enumerate resources using PowerShell.
To list all the resources within your Azure subscription, use the following command:
This command retrieves a list of all resources available under your account and displays them in a tabular format.
For more detailed guidance on managing Azure resources using PowerShell, please visit the official .