Skip to content

Commit 6d45113

Browse files
authored
Merge pull request #85 from Azure/fix-content-naming
Fix issue with naming when no subscription is present in context
2 parents 1e65c35 + 402940c commit 6d45113

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/Authentication.ResourceManager/AzureRmProfile.cs

+5
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,11 @@ public bool TryGetContextName(IAzureContext context, out string name)
401401
name = string.Format("{0} ({1}) - {2}", context.Subscription.Name, context.Subscription.Id, context.Account.Id);
402402
result = true;
403403
}
404+
else if (context.Tenant != null && context.Account != null)
405+
{
406+
name = string.Format("{0} - {1}", context.Tenant.Id, context.Account.Id);
407+
result = true;
408+
}
404409
else
405410
{
406411
name = "Default";

0 commit comments

Comments
 (0)