Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure CLI Get Current Subscription details

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

az account list only gives me the list of subscriptions.

like image 918
kumar Avatar asked Jun 12 '18 13:06

kumar


People also ask

What is my Azure subscription?

First, in the console (https://portal.azure.com/), in the search bar, search for "subscriptions", and choose the first entry, with the yellow key. This will take you to a screen that lists all the subscriptions that you have access to. In this screen, you will see your subscription, along with the Subscription ID.

How do I see all subscriptions in azure CLI?

When you use the az account list Azure CLI command, the terminal response will be JSON that contains this information about all the Azure Subscriptions your current login has access to. To view a list of all the Azure Subscriptions you have access to, run the following command: az account list.

How do I change the subscription of my Azure account?

Change the active subscription. You can change your active subscription by using the az account set command. Get a list of your subscriptions with the az account list command: Azure CLI. az account list --output table. This command lists all the subscriptions you can access.

How does the AZ account show command work with Azure subscriptions?

When the az account show command is executed, you’ll see a JSON response written to the terminal with information about the specific Azure Subscription the Azure CLI is currently set to work with: You first need to know some details about your Azure Subscriptions in order to update the Azure Subscription the Azure CLI’s context is set to.

What is Azure CLI and how does it work?

The Azure CLI helps you manage your Azure subscription, create management groups, and lock subscriptions. You might have multiple subscriptions within Azure. You can be part of more than one organization or your organization might divide access to certain resources across groupings.


1 Answers

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.

like image 58
Joy Wang Avatar answered Sep 22 '22 08:09

Joy Wang