55
66import { type ResourceGroup } from "@azure/arm-resources" ;
77import { LocationListStep , ResourceGroupListStep } from "@microsoft/vscode-azext-azureutils" ;
8- import { AzureWizard , createSubscriptionContext , nonNullProp , nonNullValue , nonNullValueAndProp , type AzureWizardExecuteStep , type AzureWizardPromptStep , type IActionContext } from "@microsoft/vscode-azext-utils" ;
8+ import { AzureWizard , createSubscriptionContext , nonNullProp , nonNullValue , nonNullValueAndProp , type IActionContext } from "@microsoft/vscode-azext-utils" ;
9+ import { ImageSource } from "../../constants" ;
910import { ext } from "../../extensionVariables" ;
1011import { ContainerAppItem } from "../../tree/ContainerAppItem" ;
1112import { ManagedEnvironmentItem } from "../../tree/ManagedEnvironmentItem" ;
@@ -35,24 +36,11 @@ export async function createContainerApp(context: IActionContext, node?: Managed
3536 ...await createActivityContext ( ) ,
3637 subscription : node . subscription ,
3738 managedEnvironment : node . managedEnvironment ,
38- alwaysPromptIngress : true
39+ imageSource : ImageSource . QuickstartImage ,
3940 } ;
4041
41- const title : string = localize ( 'createContainerApp' , 'Create container app' ) ;
42-
43- const promptSteps : AzureWizardPromptStep < ContainerAppCreateContext > [ ] = [
44- new ContainerAppNameStep ( ) ,
45- new ImageSourceListStep ( ) ,
46- new IngressPromptStep ( ) ,
47- ] ;
48-
49- const executeSteps : AzureWizardExecuteStep < ContainerAppCreateContext > [ ] = [
50- getVerifyProvidersStep < ContainerAppCreateContext > ( ) ,
51- new ContainerAppCreateStep ( ) ,
52- ] ;
53-
5442 if ( isAzdExtensionInstalled ( ) ) {
55- context . telemetry . properties . isAzdWorkspaceProject = 'true' ;
43+ wizardContext . telemetry . properties . isAzdWorkspaceProject = 'true' ;
5644 }
5745
5846 // Use the same resource group and location as the parent resource (managed environment)
@@ -63,25 +51,29 @@ export async function createContainerApp(context: IActionContext, node?: Managed
6351 await LocationListStep . setLocation ( wizardContext , nonNullProp ( node . resource , 'location' ) ) ;
6452
6553 const wizard : AzureWizard < ContainerAppCreateContext > = new AzureWizard ( wizardContext , {
66- title,
67- promptSteps,
68- executeSteps,
54+ title : localize ( 'createContainerApp' , 'Create container app' ) ,
55+ promptSteps : [
56+ new ContainerAppNameStep ( ) ,
57+ new ImageSourceListStep ( ) ,
58+ new IngressPromptStep ( ) ,
59+ ] ,
60+ executeSteps : [
61+ getVerifyProvidersStep < ContainerAppCreateContext > ( ) ,
62+ new ContainerAppCreateStep ( ) ,
63+ ] ,
6964 showLoadingPrompt : true
7065 } ) ;
71-
72- // we want to add the quick start image _only_ for the create scenairo
73- wizardContext . showQuickStartImage = true ;
74-
7566 await wizard . prompt ( ) ;
76- const newContainerAppName = nonNullProp ( wizardContext , 'newContainerAppName' ) ;
7767
68+ const newContainerAppName = nonNullProp ( wizardContext , 'newContainerAppName' ) ;
7869 await ext . state . showCreatingChild (
7970 node . managedEnvironment . id ,
8071 localize ( 'creating' , 'Creating "{0}"...' , newContainerAppName ) ,
8172 async ( ) => {
8273 wizardContext . activityTitle = localize ( 'createNamedContainerApp' , 'Create container app "{0}"' , newContainerAppName ) ;
8374 await wizard . execute ( ) ;
84- } ) ;
75+ }
76+ ) ;
8577
8678 const createdContainerApp = nonNullProp ( wizardContext , 'containerApp' ) ;
8779 if ( ! wizardContext . suppressNotification ) {
0 commit comments