How To Check Current Subscription In Azure PowerShell

Checking the current subscription in Azure is an essential task. In this article, I will walk you through all the steps to achieve this.

How To Check Current Subscription In Azure PowerShell

To check current subscription in Azure PowerShell, follow the below steps.

1. Open Windows PowerShell ISE with Run As Administrator mode.

Check Current Subscription In Azure PowerShell

2. Now, we can execute the Azure PowerShell command below to get the current subscription, as shown in the screenshot below.

Get-AzContext

After executing the above command, I got the current subscription, as shown in the screenshot below.

How To Check Current Subscription In Azure PowerShell

3. We can execute the below PowerShell command to get only the current subscription name.

(Get-AzContext).Subscription.Name

After executing the PowerShell command, I got the expected output, as shown below.

how to check current subscription in azure using powershell

4. We can execute the below PowerShell command to get only the current subscription ID.

(Get-AzContext).Tenant.Id

After executing the above PowerShell command, I got the expected output, as shown in the screenshot below.

how do i check my current subscription in azure powershell

5. We can also use the Get-AzSubscription along with the Get-AzContext command, as shown below, to retrieve the current Azure subscription details.

Get-AzSubscription -SubscriptionId (Get-AzContext).Subscription.Id

After executing the above command, I got the expected output below.

check current subscription powershell

Conclusion

We can use the Get-AzContext and Get-AzSubscription PowerShell commands to check current subscription in Azure PowerShell. Check out the information mentioned in this article to implement it in real-time.

You may also like following the articles below.

Azure Virtual Machine

DOWNLOAD FREE AZURE VIRTUAL MACHINE PDF

Download our free 25+ page Azure Virtual Machine guide and master cloud deployment today!