From 4412de47425613cbd82745c7b875d1a816f07274 Mon Sep 17 00:00:00 2001 From: MicroFish91 <40250218+MicroFish91@users.noreply.github.com> Date: Thu, 11 Dec 2025 17:54:59 -0800 Subject: [PATCH 1/5] Improve perf --- .../createAppService/AppServicePlanListStep.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/appservice/src/createAppService/AppServicePlanListStep.ts b/appservice/src/createAppService/AppServicePlanListStep.ts index 866fe7f581..b19c554f28 100644 --- a/appservice/src/createAppService/AppServicePlanListStep.ts +++ b/appservice/src/createAppService/AppServicePlanListStep.ts @@ -17,12 +17,13 @@ import { AppServicePlanRedundancyStep } from './AppServicePlanRedundancyStep'; import { AppServicePlanSkuStep } from './AppServicePlanSkuStep'; import { IAppServiceWizardContext } from './IAppServiceWizardContext'; -export class AppServicePlanListStep extends AzureWizardPromptStep { +export class AppServicePlanListStep extends AzureWizardPromptStep { private _suppressCreate: boolean | undefined; - public constructor(suppressCreate?: boolean) { + public constructor(context: T, suppressCreate?: boolean) { super(); this._suppressCreate = suppressCreate; + context.plansTask ??= AppServicePlanListStep.getPlans(context); } public static async getPlans(context: IAppServiceWizardContext): Promise { @@ -35,14 +36,14 @@ export class AppServicePlanListStep extends AzureWizardPromptStep { - const plans: AppServicePlan[] = await AppServicePlanListStep.getPlans(context); + const plans: AppServicePlan[] = await context.plansTask ?? await AppServicePlanListStep.getPlans(context); return !plans.some(plan => nonNullProp(plan, 'resourceGroup').toLowerCase() === resourceGroupName.toLowerCase() && nonNullProp(plan, 'name').toLowerCase() === name.toLowerCase() ); } - public async prompt(context: IAppServiceWizardContext): Promise { + public async prompt(context: T): Promise { // Cache hosting plan separately per subscription // Logic Apps only supports Workflow Standard sku and for App Service Plan it only supports one Isolated sku. // Since create is not enabled for isolated skus, we explicitly reference the type of plan picked in the placeHolder. @@ -60,7 +61,7 @@ export class AppServicePlanListStep extends AzureWizardPromptStep | undefined> { + public async getSubWizard(context: T): Promise | undefined> { if (!context.plan) { const promptSteps: AzureWizardPromptStep[] = [new AppServicePlanNameStep(), new AppServicePlanSkuStep(), new AppServicePlanRedundancyStep(), new ResourceGroupListStep()]; LocationListStep.addStep(context, promptSteps); @@ -74,11 +75,11 @@ export class AppServicePlanListStep extends AzureWizardPromptStep[]> { + private async getQuickPicks(context: T): Promise[]> { const picks: IAzureQuickPickItem[] = !this._suppressCreate ? [{ label: vscode.l10n.t('$(plus) Create new App Service plan'), @@ -87,7 +88,7 @@ export class AppServicePlanListStep extends AzureWizardPromptStep !plan.sku?.family || famFilter.test(plan.sku.family)); From 01cb89c7aa2d5d0d23f04046167421b5f71ff4ec Mon Sep 17 00:00:00 2001 From: MicroFish91 <40250218+MicroFish91@users.noreply.github.com> Date: Thu, 11 Dec 2025 18:03:10 -0800 Subject: [PATCH 2/5] Small fixes --- .../src/createAppService/AppServicePlanCreateStep.ts | 2 +- .../src/createAppService/AppServicePlanListStep.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/appservice/src/createAppService/AppServicePlanCreateStep.ts b/appservice/src/createAppService/AppServicePlanCreateStep.ts index 5fbf273f7f..79f1838387 100644 --- a/appservice/src/createAppService/AppServicePlanCreateStep.ts +++ b/appservice/src/createAppService/AppServicePlanCreateStep.ts @@ -118,7 +118,7 @@ class AppServicePlanNoCreatePermissionsStep extends AzureWizardExecuteStepWithAc await context.ui.showWarningMessage(message, { modal: true, stepName: 'AspNoPermissions' }, selectExisting); context.telemetry.properties.forbiddenResponse = 'SelectExistingAsp'; - const step: AppServicePlanListStep = new AppServicePlanListStep(true /* suppressCreate */); + const step: AppServicePlanListStep = new AppServicePlanListStep(context, true /* suppressCreate */); await step.prompt(context); } diff --git a/appservice/src/createAppService/AppServicePlanListStep.ts b/appservice/src/createAppService/AppServicePlanListStep.ts index b19c554f28..932917181a 100644 --- a/appservice/src/createAppService/AppServicePlanListStep.ts +++ b/appservice/src/createAppService/AppServicePlanListStep.ts @@ -17,10 +17,10 @@ import { AppServicePlanRedundancyStep } from './AppServicePlanRedundancyStep'; import { AppServicePlanSkuStep } from './AppServicePlanSkuStep'; import { IAppServiceWizardContext } from './IAppServiceWizardContext'; -export class AppServicePlanListStep extends AzureWizardPromptStep { +export class AppServicePlanListStep extends AzureWizardPromptStep { private _suppressCreate: boolean | undefined; - public constructor(context: T, suppressCreate?: boolean) { + public constructor(context: IAppServiceWizardContext, suppressCreate?: boolean) { super(); this._suppressCreate = suppressCreate; context.plansTask ??= AppServicePlanListStep.getPlans(context); @@ -43,7 +43,7 @@ export class AppServicePlanListStep extends ); } - public async prompt(context: T): Promise { + public async prompt(context: IAppServiceWizardContext): Promise { // Cache hosting plan separately per subscription // Logic Apps only supports Workflow Standard sku and for App Service Plan it only supports one Isolated sku. // Since create is not enabled for isolated skus, we explicitly reference the type of plan picked in the placeHolder. @@ -61,7 +61,7 @@ export class AppServicePlanListStep extends } } - public async getSubWizard(context: T): Promise | undefined> { + public async getSubWizard(context: IAppServiceWizardContext): Promise | undefined> { if (!context.plan) { const promptSteps: AzureWizardPromptStep[] = [new AppServicePlanNameStep(), new AppServicePlanSkuStep(), new AppServicePlanRedundancyStep(), new ResourceGroupListStep()]; LocationListStep.addStep(context, promptSteps); @@ -75,11 +75,11 @@ export class AppServicePlanListStep extends } } - public shouldPrompt(context: T): boolean { + public shouldPrompt(context: IAppServiceWizardContext): boolean { return !context.plan && !context.newPlanName; } - private async getQuickPicks(context: T): Promise[]> { + private async getQuickPicks(context: IAppServiceWizardContext): Promise[]> { const picks: IAzureQuickPickItem[] = !this._suppressCreate ? [{ label: vscode.l10n.t('$(plus) Create new App Service plan'), From 9399072b15cb66804e060660ffbf3d07f5e63c14 Mon Sep 17 00:00:00 2001 From: MicroFish91 <40250218+MicroFish91@users.noreply.github.com> Date: Thu, 11 Dec 2025 18:06:22 -0800 Subject: [PATCH 3/5] Even simpler --- appservice/src/createAppService/AppServicePlanListStep.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appservice/src/createAppService/AppServicePlanListStep.ts b/appservice/src/createAppService/AppServicePlanListStep.ts index 932917181a..d78d8df593 100644 --- a/appservice/src/createAppService/AppServicePlanListStep.ts +++ b/appservice/src/createAppService/AppServicePlanListStep.ts @@ -36,7 +36,7 @@ export class AppServicePlanListStep extends AzureWizardPromptStep { - const plans: AppServicePlan[] = await context.plansTask ?? await AppServicePlanListStep.getPlans(context); + const plans: AppServicePlan[] = await AppServicePlanListStep.getPlans(context); return !plans.some(plan => nonNullProp(plan, 'resourceGroup').toLowerCase() === resourceGroupName.toLowerCase() && nonNullProp(plan, 'name').toLowerCase() === name.toLowerCase() @@ -88,7 +88,7 @@ export class AppServicePlanListStep extends AzureWizardPromptStep !plan.sku?.family || famFilter.test(plan.sku.family)); From 47f1e0612453c681346821ed96b81d821d43d40c Mon Sep 17 00:00:00 2001 From: MicroFish91 <40250218+MicroFish91@users.noreply.github.com> Date: Thu, 11 Dec 2025 18:11:56 -0800 Subject: [PATCH 4/5] Even simpler --- appservice/src/createAppService/AppServicePlanListStep.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/appservice/src/createAppService/AppServicePlanListStep.ts b/appservice/src/createAppService/AppServicePlanListStep.ts index d78d8df593..4eb94929ae 100644 --- a/appservice/src/createAppService/AppServicePlanListStep.ts +++ b/appservice/src/createAppService/AppServicePlanListStep.ts @@ -23,7 +23,9 @@ export class AppServicePlanListStep extends AzureWizardPromptStep { From da77cbf98880509266626c6469d84ba1467848c1 Mon Sep 17 00:00:00 2001 From: MicroFish91 <40250218+MicroFish91@users.noreply.github.com> Date: Thu, 11 Dec 2025 18:12:49 -0800 Subject: [PATCH 5/5] Use void --- appservice/src/createAppService/AppServicePlanListStep.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appservice/src/createAppService/AppServicePlanListStep.ts b/appservice/src/createAppService/AppServicePlanListStep.ts index 4eb94929ae..911b686701 100644 --- a/appservice/src/createAppService/AppServicePlanListStep.ts +++ b/appservice/src/createAppService/AppServicePlanListStep.ts @@ -25,7 +25,7 @@ export class AppServicePlanListStep extends AzureWizardPromptStep {