Skip to content

Commit 2accd61

Browse files
authored
Default flex consumption for basic creation (#4351)
* Default flex consumption for basic creation * Get rid of preview label
1 parent 90300cd commit 2accd61

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/commands/createFunctionApp/FunctionAppHostingPlanStep.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ export class FunctionAppHostingPlanStep extends AzureWizardPromptStep<IFunctionA
1717
public async prompt(context: IFunctionAppWizardContext): Promise<void> {
1818
const placeHolder: string = localize('selectHostingPlan', 'Select a hosting plan.');
1919
const picks: IAzureQuickPickItem<[boolean, RegExp | undefined]>[] = [
20+
{ label: localize('flexConsumption', 'Flex Consumption'), data: [false, undefined] },
2021
{ label: localize('consumption', 'Consumption'), data: [true, undefined] },
21-
{ label: localize('flexConsumption', 'Flex Consumption'), description: 'Preview', data: [false, undefined] },
2222
{ label: localize('premium', 'Premium'), data: [false, /^EP$/i] },
2323
{ label: localize('dedicated', 'App Service Plan'), data: [false, /^((?!EP|Y|FC).)*$/i] }
2424
];
@@ -36,6 +36,12 @@ export class FunctionAppHostingPlanStep extends AzureWizardPromptStep<IFunctionA
3636
public shouldPrompt(context: IFunctionAppWizardContext): boolean {
3737
return context.useConsumptionPlan === undefined && context.dockerfilePath === undefined;
3838
}
39+
40+
public configureBeforePrompt(context: IFunctionAppWizardContext): void | Promise<void> {
41+
if (!context.advancedCreation) {
42+
setFlexConsumptionPlanProperties(context);
43+
}
44+
}
3945
}
4046

4147
export function setConsumptionPlanProperties(context: IFunctionAppWizardContext): void {

src/commands/createFunctionApp/UniqueNamePromptStep.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import { type IAppServiceWizardContext } from "@microsoft/vscode-azext-azureappservice";
77
import { AzureWizardPromptStep } from "@microsoft/vscode-azext-utils";
88
import { localize } from "../../localize";
9-
import { setConsumptionPlanProperties } from "./FunctionAppHostingPlanStep";
109
import { type IFunctionAppWizardContext } from "./IFunctionAppWizardContext";
1110

1211
export class ConfigureCommonNamesStep extends AzureWizardPromptStep<IAppServiceWizardContext> {
@@ -26,7 +25,6 @@ export class ConfigureCommonNamesStep extends AzureWizardPromptStep<IAppServiceW
2625
throw new Error(localize('noUniqueName', 'Failed to generate unique name for resources. Use advanced creation to manually enter resource names.'));
2726
}
2827
context.newResourceGroupName = context.newResourceGroupName || newName;
29-
setConsumptionPlanProperties(context);
3028
context.newStorageAccountName = newName;
3129
context.newAppInsightsName = newName;
3230
}

src/commands/createFunctionApp/createCreateFunctionAppComponents.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,8 @@ async function createFunctionAppWizard(wizardContext: IFunctionAppWizardContext)
131131
const promptSteps: AzureWizardPromptStep<IAppServiceWizardContext>[] = [];
132132
const executeSteps: AzureWizardExecuteStep<IAppServiceWizardContext>[] = [];
133133

134-
if (wizardContext.advancedCreation) {
135-
promptSteps.push(new FunctionAppHostingPlanStep());
136-
// location is required to get flex runtimes, so prompt before stack step
137-
CustomLocationListStep.addStep(wizardContext, promptSteps);
138-
}
134+
promptSteps.push(new FunctionAppHostingPlanStep());
135+
CustomLocationListStep.addStep(wizardContext, promptSteps);
139136

140137
promptSteps.push(new FunctionAppStackStep());
141138

src/tree/ResolvedFunctionAppResource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class ResolvedFunctionAppResource extends ResolvedFunctionAppBase impleme
107107

108108
public get description(): string | undefined {
109109
if (this._isFlex) {
110-
return localize('flexFunctionApp', 'Flex (Preview)');
110+
return localize('flexFunctionApp', 'Flex Consumption');
111111
}
112112
return this._state?.toLowerCase() !== 'running' ? this._state : undefined;
113113
}

0 commit comments

Comments
 (0)