Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Cli how to change subscription default

I have 3 subscription in my Azure Account, I need to change the default subscription. When i Run the command:

azure account list  

I have this output:

enter image description here

I have tried to change the default or current subscription on this way, with no results...

azure config set subscription {{MyIdSubscription}} 

Any ideas? Thanks.

like image 943
chemitaxis Avatar asked Jul 20 '16 07:07

chemitaxis


People also ask

How do I change my default subscription in Azure?

You can change the default settings of the Azure portal to meet your own preferences. Most settings are available from the Settings menu in the top right section of global page header.

How do I change the default subscription for Azure PowerShell?

To change the azure subscription using PowerShell, we can use the Select-AZSubscription command. When you use this command, you can use either the subscription ID, Subscription Name, or the Tenant ID.

How do I get a current subscription to Azure CLI?

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 .

Which CLI command is used to connect to a specific Azure subscription?

To connect to the specific azure subscription using Az CLI we need to use “Az account set” command but before using this command make sure you are connected with the Azure cloud using “az login” account. You can also use -s instead of --subscription.


1 Answers

For Azure CLI 2.0 (preview) I had to use

az account set --subscription <name or id> 
like image 192
Ida Avatar answered Sep 28 '22 03:09

Ida