Azure Cli如何更改订阅默认值

问题描述 投票:32回答:3

我的Azure帐户中有3个订阅,我需要更改默认订阅。当我运行命令时:

azure account list 

我有这个输出:

enter image description here

我试图以这种方式更改默认或当前订阅,没有结果......

azure config set subscription {{MyIdSubscription}}

有任何想法吗?谢谢。

azure azure-cli
3个回答
88
投票

对于Azure CLI 2.0(预览版),我必须使用

az account set --subscription <name or id>

15
投票

请尝试以下方法:

azure account set -s {Subscription Id}

这应该会改变订阅。


0
投票

使用GUID的id(订阅ID),这将在您执行az login时列出

enter image description here

然后执行以下命令..

az account set --subscription fffde5cb-cccc-aaaa-eee-457c3292608e
© www.soinside.com 2019 - 2024. All rights reserved.