The Get-AzResource cmdlet retrieves resources in Azure Resource Manager.
You can use this cmdlet to get a specific resource or all resources within a resource group,
subscription, or management group.
Get-AzResource [-ApiVersion ] [-Body
| Name | Type | Description |
|---|---|---|
| -ApiVersion | [String] | Specifies the API version of the resource type to use. |
| -Body | [Object] | Specifies the body of the resource to get. |
| -ClientAssembly | [Assembly] | Specifies the assembly for the client. |
| -ClientObjectId | [Guid] | Specifies the object ID of the client. |
| -ODataFilter | [String] | Specifies an OData filter to apply to the query. |
| -ODataQuery | [String] | Specifies an OData query to apply to the request. |
| -ProviderName | [String] | Specifies the resource provider name, such as Microsoft.Storage. |
| -ResourceGroupName | [String] | Specifies the name of the resource group that contains the resources. |
| -ResourceName | [String] | Specifies the name of the resource. |
| -ResourceType | [String] | Specifies the type of the resource, such as Microsoft.Storage/storageAccounts. |
| -SubscriptionId | [Guid] | Specifies the ID of the subscription. |
| -DefaultProfile | [IAzureContextContainer] | The credentials, account, tenant, and subscription that are used for communication with Azure. |
Get-AzResource
Get-AzResource -ResourceGroupName "MyResourceGroup"
Get-AzResource -ResourceGroupName "MyResourceGroup" -ResourceType "Microsoft.Storage/storageAccounts" -ResourceName "mystorageaccount"
Get-AzResource -ResourceGroupName "MyResourceGroup" -ResourceType "Microsoft.Storage/storageAccounts"
Get-AzResource -Tag @{"Environment"="Production"}