Skip to content

Commit

Permalink
Remove context population
Browse files Browse the repository at this point in the history
  • Loading branch information
cormacpayne committed May 1, 2018
1 parent b0144f8 commit a1304ac
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 27 deletions.
1 change: 0 additions & 1 deletion src/ResourceManager/Profile/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ public AzureRmProfile Login(
}
}

bool shouldPopulateContextList = _profile.DefaultContext?.Account == null;
if (newSubscription == null)
{
if (subscriptionId != null)
Expand Down Expand Up @@ -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();
}
Expand Down
1 change: 0 additions & 1 deletion tools/AzureRM/AzureRM.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a1304ac

Please sign in to comment.