This Azure PowerShell article will discuss the syntax and usage of the Get-AzSubscription PowerShell command and examples of how to get the List of all Azure Subscriptions using this command.
Table of Contents
Get-AzSubscription
If you wish to get the List of Azure Subscriptions, then the Get-AzSubscription PowerShell command can help you achieve this.
Syntax of Get-AzSubscription
Below is the syntax of the Get-AzSubscription PowerShell command.
Get-AzSubscriptionGet-AzSubscription [-TenantId <String>]Get-AzSubscription [-SubscriptionName <String>] [-TenantId <String>]Well, let’s discuss a few examples of how to use the Get-AzSubscription PowerShell command.
Example-1:
You can execute the below PowerShell command to get the lists of Azure Subscriptions.
Get-AzSubscriptionAfter executing the PowerShell command, we got the expected output below.
PS C:\WINDOWS\system32> Get-AzSubscription
Name Id TenantId State
---- -- -------- -----
Visual Studio Enterprise 1cdf4300-dee5-4518-9c9c-feaa72a5cbd1 5d9d690a-0310-474d-ae8b-42df2d549228 Enabled
You can see the same output below

Example-2:
You can execute the below PowerShell command to get the specific Azure subscription based on the specified TenantId.
Get-AzSubscription -TenantId '5d9d690a-0310-474d-ae8b-42df2d549228'After executing the above PowerShell command, we got the expected output, as shown below.

Example-3:
You can also execute the below PowerShell command to get the lists of subscriptions in the current tenant.
Get-AzSubscription -TenantId (Get-AzContext).TenantAfter executing the above command, I got the expected output below

Get-AzSubscription PowerShell – Video Tutorial
You can also check out a video tutorial on the Get-AzSubscription command.
Final Thoughts
In this Azure PowerShell command, we discussed the syntax and usage of the Get-AzSubscription PowerShell command with certain examples of how to use this particular command.
Check out How To Set Subscription In Azure PowerShell

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.
