我的Azure帐户中有3个订阅,我需要更改默认订阅.当我运行命令时:
azure account list
Run Code Online (Sandbox Code Playgroud)
我有这个输出:
我试图以这种方式更改默认或当前订阅,没有结果......
azure config set subscription {{MyIdSubscription}}
Run Code Online (Sandbox Code Playgroud)
有任何想法吗?谢谢.
小智 95
对于Azure CLI 2.0(预览版),我必须使用
az account set --subscription <name or id>
Run Code Online (Sandbox Code Playgroud)
Aka*_*ppa 29
1. List all the subscriptions you have
az account list --output table
Name CloudName SubscriptionId State IsDefault
--------------- ------------ ---------------- --------- ----------
AssociateProd AzureCloud xxxxxxxxxxxx Enabled False
2. Pick the subscription you want and use it in the command below.
az account set --subscription <subscription_id>
Run Code Online (Sandbox Code Playgroud)
Gau*_*tri 16
请尝试以下方法:
azure account set -s {Subscription Id}
Run Code Online (Sandbox Code Playgroud)
这应该会改变订阅.
小智 12
Azure CLI 最新版 (2.39.0):
az account set (--name or -n) <name>
az account set (--subscription or -s) <id>
Run Code Online (Sandbox Code Playgroud)
Kar*_* VK 10
使用id(订阅 id),即 GUID,当您这样做时会列出该 ID az login
然后执行以下命令..
az account set --subscription fffde5cb-cccc-aaaa-eee-457c3292608e
Run Code Online (Sandbox Code Playgroud)
以这种方式尝试。将 Azure PowerShell 设置为特定的 Azure 订阅对我有用
Set-AzContext -SubscriptionId "t666-e251-49ce-a1cd-5c3144"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
31338 次 |
| 最近记录: |