Retrieving subscriptions for the selection...
[Tenant and subscription selection]
No Subscription name Subscription ID Tenant name
---- ------------------------------------ ---------------------------------------- --------------
[1] Facility Services Subscription 00000000-0000-0000-0000-000000000000 Contoso
[2] Finance Department Subscription 00000000-0000-0000-0000-000000000000 Contoso
[3] Human Resources Subscription 00000000-0000-0000-0000-000000000000 Contoso
[4] * Information Technology Subscription 00000000-0000-0000-0000-000000000000 Contoso
The default is marked with an *; the default tenant is 'Contoso' and subscription is
'Information Technology Subscription' (00000000-0000-0000-0000-000000000000).
Select a subscription and tenant (Type a number or Enter for no changes): 2
Tenant: Contoso
Subscription: Finance Department Subscription (00000000-0000-0000-0000-000000000000)
[Announcements]
With the new Azure CLI login experience, you can select the subscription you want to use more easily.
Learn more about it and its configuration at https://go.microsoft.com/fwlink/?linkid=2271236
If you encounter any problem, please open an issue at https://aka.ms/azclibug
下次登录时,之前选择的租户和订阅将标记为默认值,其编号旁边带有星号(*)。 通过此标记,可以按 Enter 选择默认订阅。
默认情况下,命令针对所选订阅运行。 随时可以使用 az account set 从命令行更改订阅。 有关详细信息,请参阅 如何使用 Azure CLI 管理 Azure 订阅。
# disable the subscription selector (v. 2.61.0 and up)az config set core.login_experience_v2=off
# login with a tenant IDaz login --tenant00000000-0000-0000-0000-000000000000
若要重新允许订阅选择器,请运行 az config set core.login_experience_v2=on。 有关订阅选择器的详细信息,请参阅 交互式登录。
# get access token for the active subscriptionaz account get-access-token# get access token for a specific subscriptionaz account get-access-token --subscription"<subscription ID or name>"