diff --git a/src/ResourceManager/Profile/ChangeLog.md b/src/ResourceManager/Profile/ChangeLog.md index c1eba690569d..1bb9774ec63a 100644 --- a/src/ResourceManager/Profile/ChangeLog.md +++ b/src/ResourceManager/Profile/ChangeLog.md @@ -22,7 +22,6 @@ ## Version 5.0.0 * Set minimum dependency of module to PowerShell 5.0 * Enable context autosave by default -* Create a context for each subscription when running `Connect-AzureRmAccount` with no previous context * Add USGovernmentOperationalInsightsEndpoint and USGovernmentOperationalInsightsEndpointResourceId properties to Azure environment for US Gov. ## Version 4.6.0 diff --git a/src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs b/src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs index 99fb465918e0..9b6c90c6fc6e 100644 --- a/src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs +++ b/src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs @@ -226,7 +226,6 @@ public AzureRmProfile Login( } } - bool shouldPopulateContextList = _profile.DefaultContext?.Account == null; if (newSubscription == null) { if (subscriptionId != null) @@ -261,30 +260,6 @@ public AzureRmProfile Login( } _profile.DefaultContext.TokenCache = _cache; - var defaultContext = _profile.DefaultContext; - if (shouldPopulateContextList) - { - var subscriptions = ListSubscriptions(tenantId); - foreach (var subscription in subscriptions) - { - var tempContext = new AzureContext(subscription, account, environment, newTenant); - tempContext.TokenCache = _cache; - string tempName = null; - if (!_profile.TryGetContextName(tempContext, out tempName)) - { - WriteWarningMessage(string.Format("Unable to get context name for subscription with id '{0}'.", subscription.Id)); - continue; - } - - if (!_profile.TrySetContext(tempName, tempContext)) - { - WriteWarningMessage(string.Format("Cannot create a context for subscription with id '{0}'.", subscription.Id)); - } - } - - _profile.TrySetDefaultContext(defaultContext); - _profile.TryRemoveContext("Default"); - } return _profile.ToProfile(); } diff --git a/tools/AzureRM/AzureRM.psd1 b/tools/AzureRM/AzureRM.psd1 index 7ed26a4dae22..cccba1d3e6d4 100644 --- a/tools/AzureRM/AzureRM.psd1 +++ b/tools/AzureRM/AzureRM.psd1 @@ -265,7 +265,6 @@ AzureRM.OperationalInsights AzureRM.Profile * Enable context autosave by default -* Create a context for each subscription when running Connect-AzureRmAccount * Add USGovernment OperationalInsights endpoints to Azure environment for US Gov. AzureRM.RecoveryServices.SiteRecovery