Skip to content

Commit a1304ac

Browse files
committed
Remove context population
1 parent b0144f8 commit a1304ac

File tree

3 files changed

+0
-27
lines changed

3 files changed

+0
-27
lines changed

src/ResourceManager/Profile/ChangeLog.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
## Version 5.0.0
2323
* Set minimum dependency of module to PowerShell 5.0
2424
* Enable context autosave by default
25-
* Create a context for each subscription when running `Connect-AzureRmAccount` with no previous context
2625
* Add USGovernmentOperationalInsightsEndpoint and USGovernmentOperationalInsightsEndpointResourceId properties to Azure environment for US Gov.
2726

2827
## Version 4.6.0

src/ResourceManager/Profile/Commands.Profile/Models/RMProfileClient.cs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ public AzureRmProfile Login(
226226
}
227227
}
228228

229-
bool shouldPopulateContextList = _profile.DefaultContext?.Account == null;
230229
if (newSubscription == null)
231230
{
232231
if (subscriptionId != null)
@@ -261,30 +260,6 @@ public AzureRmProfile Login(
261260
}
262261

263262
_profile.DefaultContext.TokenCache = _cache;
264-
var defaultContext = _profile.DefaultContext;
265-
if (shouldPopulateContextList)
266-
{
267-
var subscriptions = ListSubscriptions(tenantId);
268-
foreach (var subscription in subscriptions)
269-
{
270-
var tempContext = new AzureContext(subscription, account, environment, newTenant);
271-
tempContext.TokenCache = _cache;
272-
string tempName = null;
273-
if (!_profile.TryGetContextName(tempContext, out tempName))
274-
{
275-
WriteWarningMessage(string.Format("Unable to get context name for subscription with id '{0}'.", subscription.Id));
276-
continue;
277-
}
278-
279-
if (!_profile.TrySetContext(tempName, tempContext))
280-
{
281-
WriteWarningMessage(string.Format("Cannot create a context for subscription with id '{0}'.", subscription.Id));
282-
}
283-
}
284-
285-
_profile.TrySetDefaultContext(defaultContext);
286-
_profile.TryRemoveContext("Default");
287-
}
288263

289264
return _profile.ToProfile();
290265
}

tools/AzureRM/AzureRM.psd1

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,6 @@ AzureRM.OperationalInsights
265265
266266
AzureRM.Profile
267267
* Enable context autosave by default
268-
* Create a context for each subscription when running Connect-AzureRmAccount
269268
* Add USGovernment OperationalInsights endpoints to Azure environment for US Gov.
270269
271270
AzureRM.RecoveryServices.SiteRecovery

0 commit comments

Comments
 (0)