How to find the current Azure RM Subscription

Michael B picture Michael B · Jan 21, 2016 · Viewed 20.5k times · Source

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?

Answer

BenV picture BenV · Jan 21, 2016

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

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