From 7a2f53f7b218a174fe9792a8e40bc511766fb294 Mon Sep 17 00:00:00 2001 From: Yeming Liu <11371776+isra-fel@users.noreply.github.com> Date: Fri, 17 Jun 2022 10:42:37 +0800 Subject: [PATCH 1/2] upadte message when >1 sub --- src/Accounts/Accounts/Models/RMProfileClient.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Accounts/Accounts/Models/RMProfileClient.cs b/src/Accounts/Accounts/Models/RMProfileClient.cs index d0aa5ef9f56f..8b55f32ea76a 100644 --- a/src/Accounts/Accounts/Models/RMProfileClient.cs +++ b/src/Accounts/Accounts/Models/RMProfileClient.cs @@ -601,7 +601,9 @@ private bool TryGetTenantSubscription(IAccessToken accessToken, { WriteWarningMessage(string.Format( "TenantId '{0}' contains more than one active subscription. First one will be selected for further use. " + - "To select another subscription, use Set-AzContext.", + "To select another subscription, use Set-AzContext. " + + "To override which subscription Connect-AzAccount selects, " + + "use `Update-AzConfig -DefaultSubscriptionForLogin SubscriptionNameOrId`.", accessToken.TenantId)); } subscription = subscription ?? subscriptions.First(); From 239f2f8d2c584a9bd4ec0c8444e66541bf77003d Mon Sep 17 00:00:00 2001 From: Yeming Liu <11371776+isra-fel@users.noreply.github.com> Date: Tue, 21 Jun 2022 09:52:00 +0800 Subject: [PATCH 2/2] Update src/Accounts/Accounts/Models/RMProfileClient.cs Co-authored-by: Mike F. Robbins --- src/Accounts/Accounts/Models/RMProfileClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Accounts/Accounts/Models/RMProfileClient.cs b/src/Accounts/Accounts/Models/RMProfileClient.cs index 8b55f32ea76a..207224fec542 100644 --- a/src/Accounts/Accounts/Models/RMProfileClient.cs +++ b/src/Accounts/Accounts/Models/RMProfileClient.cs @@ -602,8 +602,8 @@ private bool TryGetTenantSubscription(IAccessToken accessToken, WriteWarningMessage(string.Format( "TenantId '{0}' contains more than one active subscription. First one will be selected for further use. " + "To select another subscription, use Set-AzContext. " + - "To override which subscription Connect-AzAccount selects, " + - "use `Update-AzConfig -DefaultSubscriptionForLogin SubscriptionNameOrId`.", + "To override which subscription Connect-AzAccount selects by default, " + + "use `Update-AzConfig -DefaultSubscriptionForLogin `.", accessToken.TenantId)); } subscription = subscription ?? subscriptions.First();