Search code examples
azureazure-cli2

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.


Solution

  • For Azure CLI 2.0 (preview) I had to use

    az account set --subscription <name or id>