in src/tree/SubscriptionTreeItem.ts [52:107]
public async createChildImpl(context: ICreateChildImplContext): Promise<AzExtTreeItem> {
const wizardContext: IStorageAccountWizardContext = Object.assign(context, this.subscription);
wizardContext.includeExtendedLocations = true;
const defaultLocation: string | undefined = wizardContext.isCustomCloud ? undefined : 'westus';
const promptSteps: AzureWizardPromptStep<IStorageAccountWizardContext>[] = [new StorageAccountNameStep()];
const executeSteps: AzureWizardExecuteStep<IStorageAccountWizardContext>[] = [
new StorageAccountCreateStep({ kind: wizardContext.isCustomCloud ? StorageAccountKind.Storage : StorageAccountKind.StorageV2, performance: StorageAccountPerformance.Standard, replication: StorageAccountReplication.LRS }),
new StorageAccountTreeItemCreateStep(this),
new StaticWebsiteConfigureStep(),
new VerifyProvidersStep([storageProvider])
];
LocationListStep.addProviderForFiltering(wizardContext, storageProvider, 'storageAccounts');
if (context.advancedCreation) {
promptSteps.push(new ResourceGroupListStep());
promptSteps.push(new StaticWebsiteEnableStep());
LocationListStep.addStep(wizardContext, promptSteps);
LocationListStep.getQuickPickDescription = (location: AzExtLocation) => {
return location.metadata?.regionCategory === 'Extended' ? localize('onlyPremiumSupported', 'Only supports Premium storage accounts') : undefined;
}
} else {
executeSteps.push(new ResourceGroupCreateStep());
Object.assign(wizardContext, {
enableStaticWebsite: wizardContext.isCustomCloud ? false : true,
indexDocument: wizardContext.isCustomCloud ? "" : StaticWebsiteIndexDocumentStep.defaultIndexDocument,
errorDocument404Path: wizardContext.isCustomCloud ? "" : StaticWebsiteErrorDocument404Step.defaultErrorDocument404Path
});
if (defaultLocation) {
await LocationListStep.setLocation(wizardContext, defaultLocation);
} else {
LocationListStep.addStep(wizardContext, promptSteps);
}
}
const wizard = new AzureWizard(wizardContext, {
title: "Create storage account",
promptSteps,
executeSteps
});
await wizard.prompt();
if (!context.advancedCreation) {
wizardContext.newResourceGroupName = await wizardContext.relatedNameTask;
}
await vscode.window.withProgress({ location: vscode.ProgressLocation.Window }, async () => {
context.showCreatingTreeItem(nonNull(wizardContext.newStorageAccountName));
await wizard.execute();
});
// In case this account has been created via a deploy or browse command, the enable website hosting prompt shouldn't be shown
(<ISelectStorageAccountContext>context).showEnableWebsiteHostingPrompt = false;
return (<IStorageAccountTreeItemCreateContext>wizardContext).accountTreeItem;
}