@@ -16,40 +16,39 @@ import { type IFunctionAppWizardContext } from './IFunctionAppWizardContext';
1616export class FunctionAppHostingPlanStep extends AzureWizardPromptStep < IFunctionAppWizardContext > {
1717 public async prompt ( context : IFunctionAppWizardContext ) : Promise < void > {
1818 const placeHolder : string = localize ( 'selectHostingPlan' , 'Select a hosting plan.' ) ;
19- const picks : IAzureQuickPickItem < [ boolean , RegExp | undefined ] > [ ] = [
20- { label : localize ( 'flexConsumption' , 'Flex Consumption' ) , data : [ false , undefined ] } ,
21- { label : localize ( 'consumption' , 'Consumption' ) , data : [ true , undefined ] } ,
22- { label : localize ( 'premium' , 'Premium' ) , data : [ false , / ^ E P $ / i] } ,
23- { label : localize ( 'dedicated' , 'App Service Plan' ) , data : [ false , / ^ ( (? ! E P | Y | F C ) .) * $ / i] }
19+ const picks : IAzureQuickPickItem < [ boolean , boolean , RegExp | undefined ] > [ ] = [
20+ { label : localize ( 'flexConsumption' , 'Flex Consumption' ) , data : [ false , true , undefined ] } ,
21+ { label : localize ( 'consumption' , 'Linux Consumption' ) , description : localize ( 'legacy' , 'Legacy' ) , data : [ true , false , undefined ] } ,
22+ { label : localize ( 'premium' , 'Premium' ) , data : [ false , false , / ^ E P $ / i] } ,
23+ { label : localize ( 'dedicated' , 'App Service Plan' ) , data : [ false , false , / ^ ( (? ! E P | Y | F C ) .) * $ / i] }
2424 ] ;
2525
26- [ context . useConsumptionPlan , context . planSkuFamilyFilter ] = ( await context . ui . showQuickPick ( picks , { placeHolder } ) ) . data ;
26+ [ context . useConsumptionPlan , context . useFlexConsumptionPlan , context . planSkuFamilyFilter ] = ( await context . ui . showQuickPick ( picks , { placeHolder, learnMoreLink : 'aka.ms/flexconsumption' } ) ) . data ;
2727 await setLocationsTask ( context ) ;
2828 if ( context . useConsumptionPlan ) {
2929 setConsumptionPlanProperties ( context ) ;
30- } else if ( ! context . useConsumptionPlan && ! context . planSkuFamilyFilter ) {
31- // if it's not consumption and has no filter, then it's flex consumption
30+ } else if ( context . useFlexConsumptionPlan ) {
3231 setFlexConsumptionPlanProperties ( context ) ;
3332 }
3433 }
3534
3635 public shouldPrompt ( context : IFunctionAppWizardContext ) : boolean {
37- return context . useConsumptionPlan === undefined && context . dockerfilePath === undefined ;
36+ return context . useFlexConsumptionPlan === undefined && context . dockerfilePath === undefined ;
3837 }
3938
4039 public configureBeforePrompt ( context : IFunctionAppWizardContext ) : void | Promise < void > {
41- if ( ! context . advancedCreation ) {
40+ if ( context . useFlexConsumptionPlan ) {
4241 setFlexConsumptionPlanProperties ( context ) ;
4342 }
4443 }
4544}
4645
47- export function setConsumptionPlanProperties ( context : IFunctionAppWizardContext ) : void {
46+ function setConsumptionPlanProperties ( context : IFunctionAppWizardContext ) : void {
4847 context . newPlanName = `ASP-${ nonNullProp ( context , 'newSiteName' ) } -${ getRandomHexString ( 4 ) } ` ;
4948 context . newPlanSku = { name : 'Y1' , tier : 'Dynamic' , size : 'Y1' , family : 'Y' , capacity : 0 } ;
5049}
5150
52- export function setFlexConsumptionPlanProperties ( context : IAppServiceWizardContext ) : void {
51+ function setFlexConsumptionPlanProperties ( context : IAppServiceWizardContext ) : void {
5352 context . newPlanName = `FLEX-${ nonNullProp ( context , 'newSiteName' ) } -${ getRandomHexString ( 4 ) } ` ;
5453 context . newPlanSku = { name : 'FC1' , tier : 'FlexConsumption' , size : 'FC' , family : 'FC' } ;
5554 // flex consumption only supports linux
0 commit comments