diff --git a/packages/vscode-extension/package.nls.json b/packages/vscode-extension/package.nls.json index f7f217d21d..5376902e26 100644 --- a/packages/vscode-extension/package.nls.json +++ b/packages/vscode-extension/package.nls.json @@ -101,6 +101,8 @@ "teamstoolkit.commands.selectTutorials.title": "View How-to Guides", "teamstoolkit.commands.switchTenant.m365.title": "Switch between your available tenants for Microsoft 365 account", "teamstoolkit.commands.switchTenant.azure.title": "Switch between your available tenants for Azure account", + "teamstoolkit.commands.switchTenant.progressbar.title": "Switch tenant", + "teamstoolkit.commands.switchTenant.progressbar.detail": "Teams Toolkit is now switching to the newly selected tenant.", "teamstoolkit.commands.signOut.title": "Sign Out", "teamstoolkit.commands.checkCopilotAccess.title": "Check Copilot Access", "teamstoolkit.commands.updateManifest.title": "Update Teams App", diff --git a/packages/vscode-extension/src/handlers/accounts/switchTenantHandler.ts b/packages/vscode-extension/src/handlers/accounts/switchTenantHandler.ts index a9cbd8a3c7..bcc543a137 100644 --- a/packages/vscode-extension/src/handlers/accounts/switchTenantHandler.ts +++ b/packages/vscode-extension/src/handlers/accounts/switchTenantHandler.ts @@ -41,7 +41,14 @@ export async function onSwitchM365Tenant(...args: unknown[]): Promise { }; const result = await VS_CODE_UI.selectOption(config); if (result.isOk()) { + const progressHandler = VS_CODE_UI.createProgressBar( + localize("teamstoolkit.commands.switchTenant.progressbar.title"), + 1 + ); + await progressHandler.start(); + await progressHandler.next(localize("teamstoolkit.commands.switchTenant.progressbar.detail")); const switchRes = await M365TokenInstance.switchTenant(result.value.result as string); + await progressHandler.end(switchRes.isOk()); if (switchRes.isOk()) { ExtTelemetry.sendTelemetryEvent(TelemetryEvent.SwitchTenant, { [TelemetryProperty.AccountType]: AccountType.M365, @@ -100,7 +107,14 @@ export async function onSwitchAzureTenant(...args: unknown[]): Promise { const result = await VS_CODE_UI.selectOption(config); let error: any; if (result.isOk()) { + const progressHandler = VS_CODE_UI.createProgressBar( + localize("teamstoolkit.commands.switchTenant.progressbar.title"), + 1 + ); + await progressHandler.start(); + await progressHandler.next(localize("teamstoolkit.commands.switchTenant.progressbar.detail")); const switchRes = await azureAccountManager.switchTenant(result.value.result as string); + await progressHandler.end(switchRes.isOk()); if (switchRes.isOk()) { ExtTelemetry.sendTelemetryEvent(TelemetryEvent.SwitchTenant, { [TelemetryProperty.AccountType]: AccountType.Azure,