24

How do I find the current Azure subscription using Azure CLI.

az account list only gives me the list of subscriptions.

Joy Wang
  • 39,905
  • 3
  • 30
  • 54
kumar
  • 8,207
  • 20
  • 85
  • 176

2 Answers2

46

You could use az account show to do it, if you do not specify the property, it gets the the details of the current subscription.

enter image description here

For more details, refer to this link.

Joy Wang
  • 39,905
  • 3
  • 30
  • 54
10

You can run : az account list -o table.

The output will be a list of resources in table form. The details of your current subscription will be on line with IsDefault = True. Highlighted in green in the figure below.enter image description here

Mwiza
  • 7,780
  • 3
  • 46
  • 42