Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the current Azure RM Subscription

In Azure Classic / Service Management, Get-AzureSubscription would give a list of subscriptions in the Tenant with an indicator of which was current.

There was also a Get-AzureSubscription -Current flag that would give you just the current subscription.

Is there a way to find the current subscription in AzureRM.Profile?

like image 527
Michael B Avatar asked Sep 09 '25 16:09

Michael B


2 Answers

Get-AzureRmContext gives you info about the selected subscription, default storage account, etc.

(Get-AzureRmContext).Subscription gives you the current subscription.

like image 79
BenV Avatar answered Sep 13 '25 00:09

BenV


Now you can use the new Az commands

Get-AzContext

like image 41
Jucer Avatar answered Sep 12 '25 23:09

Jucer