From aba7597e75ed88e87d2eced5d22228644802ccb3 Mon Sep 17 00:00:00 2001 From: alexweininger Date: Fri, 6 Dec 2024 15:31:13 -0800 Subject: [PATCH] Fix cloudShell pick tenant step --- src/cloudConsole/cloudConsole.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cloudConsole/cloudConsole.ts b/src/cloudConsole/cloudConsole.ts index 9c6e0ac1..e1b42bf2 100644 --- a/src/cloudConsole/cloudConsole.ts +++ b/src/cloudConsole/cloudConsole.ts @@ -360,12 +360,14 @@ export function createCloudConsole(subscriptionProvider: AzureSubscriptionProvid // If they have only one tenant with subscriptions, use it. If there's no tenant with subscriptions, use the first tenant. selectedTenant = tenantsWithSubs[0] ?? tenants[0]; } else { + const duplicates = tenantsWithSubs.filter((tenant, index, self) => self.findIndex(t => t.tenantId === tenant.tenantId) !== index); // Multipe tenants with subscriptions, user must pick a tenant serverQueue.push({ type: 'log', args: [localize('selectingTenant', `Selecting tenant...`)] }); const picks = tenantsWithSubs.map(tenant => { const defaultDomainName: string | undefined = tenant.defaultDomain; + const isDuplicate = duplicates.some(dup => dup.tenantId === tenant.tenantId); return >{ - label: tenant.displayName, + label: isDuplicate ? `${tenant.displayName} (${tenant.account.label})` : tenant.displayName, description: defaultDomainName, data: tenant, };