In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzResource Azure PowerShell cmdlet with examples.
Table of Contents
Get-AzResource
Get-AzResource is an excellent Azure PowerShell cmdlet that can help you to get a list of all the Azure resources.
Syntax of Get-AzResource
Below is the syntax of the Get-AzResource Azure PowerShell cmdlet.
Get-AzResourceGet-AzResource
[-Name <String>]
[-ResourceType <String>]
[<CommonParameters>]Let’s discuss some examples
Example-1:
You can execute the below Azure PowerShell cmdlet to get the list of resources under your current subscription.
Get-AzResource
Once I executed the above Azure PowerShell cmdlet, I got the expected output, as shown below.

If you want the same output in a tabular structure, you can run the below Azure PowerShell cmdlet.
Get-AzResource | Format-TableAfter executing the above command, I got the below output as shown in the screenshot below.

Example-2:
The below Azure PowerShell cmdlet will help you retrieve all the resources under the DEMORG2 resource group.
Get-AzResource -ResourceGroupName DEMORG2 | Format-TableAfter executing the above cmdlet, I got the below output, as shown in the screenshot below.

Example-3:
You can execute the below Azure PowerShell cmdlet that can help you to retrieve all the Azure resources with the provided name.
Get-AzResource -Name tsinfo | Format-List
After executing the above Azure PowerShell cmdlet, I got the below expected output.

Example-4:
Below Azure PowerShell cmdlet that can help you to get all the resources whose name matches the specified wildcard.
Get-AzResource -Name tsinfo* | Format-TableAfter executing the above Azure PowerShell cmdlet, I got the below expected output.

Example-5:
You can also use the below Azure PowerShell cmdlet to retrieve the Azure resource based on the resource id.
Get-AzResource -ResourceId /subscriptions/1cdf4300-dee5-4518-8c8c-feaa72a5chu1/resourceGroups/DEMORG1/providers/Microsoft.ServiceBus/namespaces/TsInfoAfter executing the above Azure PowerShell cmdlet, I got the below output.

Video Tutorial
You may also like following the articles below
- New-AzResource
- Get-AzResourceProvider
- Get-AzResourceLock
- The ‘Get-AzResourceGroup’ command was found in the module ‘Az. Resources
- How to find Resource ID in the Azure portal
Wrapping Up
In this Azure PowerShell article, we have discussed the syntax and usage of the Get-AzResource Azure PowerShell cmdlet with examples. Thanks for reading this article !!!

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
