我在 Windows 命令提示符下使用了 CLI。
C:\Users\gbonk>azure account list
info: Executing command account list
data: Name Id Current State
data: ------------- ------------------------------------ ------- --------
data: Free Trial ********-****-****-****-************ false Disabled
data: Pay-As-You-Go ********-****-****-****-************ true Enabled
info: account list command OK
查看“帐户显示”,您可以看到 Pay 帐户当前不是默认帐户。
C:\Users\gbonk>azure account show Pay-As-You-Go
info: Executing command account show
data: Name : Pay-As-You-Go
data: ID : ********-****-****-****-************
data: State : Enabled
data: Tenant ID : ********-****-****-****-************
data: Is Default : false
data: Environment : AzureCloud
data: Has Certificate : No
data: Has Access Token : Yes
data: User name : gbonk
data:
info: account show command OK
执行以下命令后,付费订阅成为我的默认
C:\Users\gbonk>azure account set Pay-As-You-Go
info: Executing command account set
info: Setting subscription to "Pay-As-You-Go" with id "********-****-****-****-************".
info: Changes saved
info: account set command OK
付费订阅现在是我的默认设置
C:\Users\gbonk>azure account show Pay-As-You-Go
info: Executing command account show
data: Name : Pay-As-You-Go
data: ID : ********-****-****-****-************
data: State : Enabled
data: Tenant ID : ********-****-****-****-************
data: Is Default : true
data: Environment : AzureCloud
data: Has Certificate : No
data: Has Access Token : Yes
data: User name : gbonk
data:
info: account show command OK
您也可以在 ~/.azure/azureProfile.json 中检查