Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get current Subscription ID

Using the Powershell Azure module, is there a way to get the active subscription ID?

I can set the subscription using Set-AzContext, but Get-AzContext returns the subscription name without a specific ID column

Get-AzSubscription returns a list of subscriptions, but not the active subscription.

like image 677
Ron Dunn Avatar asked Aug 28 '26 17:08

Ron Dunn


1 Answers

you could do that with the following command:

(Get-AzContext).Subscription.id
like image 125
4c74356b41 Avatar answered Aug 31 '26 05:08

4c74356b41



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!