From b7ea300a400f724d61c377cedb48e0a08bd2be07 Mon Sep 17 00:00:00 2001 From: andrew-eldridge Date: Fri, 21 Nov 2025 14:31:12 -0500 Subject: [PATCH 1/2] prompt for azure connector details and start design-time host on new projects --- .../CodeProjectBase/CreateLogicAppProjects.ts | 6 ++++++ .../src/app/commands/workflows/azureConnectorWizard.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/CreateLogicAppProjects.ts b/apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/CreateLogicAppProjects.ts index 015232c35b6..75ddcb31596 100644 --- a/apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/CreateLogicAppProjects.ts +++ b/apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/CreateLogicAppProjects.ts @@ -18,6 +18,8 @@ import { createRulesFiles, updateWorkspaceFile, } from './CreateLogicAppWorkspace'; +import { getAzureConnectorDetailsForLocalProject } from '../../../utils/codeless/common'; +import { startDesignTimeApi } from '../../../utils/codeless/startDesignTimeApi'; export async function createLogicAppProject(context: IActionContext, options: any, workspaceRootFolder: any): Promise { addLocalFuncTelemetry(context); @@ -83,5 +85,9 @@ export async function createLogicAppProject(context: IActionContext, options: an const createFunctionAppFilesStep = new CreateFunctionAppFiles(); await createFunctionAppFilesStep.setup(mySubContext); } + + getAzureConnectorDetailsForLocalProject(context, logicAppFolderPath); + startDesignTimeApi(logicAppFolderPath); + vscode.window.showInformationMessage(localize('finishedCreating', 'Finished creating project.')); } diff --git a/apps/vs-code-designer/src/app/commands/workflows/azureConnectorWizard.ts b/apps/vs-code-designer/src/app/commands/workflows/azureConnectorWizard.ts index 530bfffe1d0..8ea4097e7ac 100644 --- a/apps/vs-code-designer/src/app/commands/workflows/azureConnectorWizard.ts +++ b/apps/vs-code-designer/src/app/commands/workflows/azureConnectorWizard.ts @@ -41,6 +41,7 @@ export function createAzureWizard(wizardContext: IAzureConnectorsContext, projec executeSteps: [new SaveAzureContext(projectPath)], }); } + class GetSubscriptionDetailsStep extends AzureWizardPromptStep { private _projectPath: string; From adfa5280ce5fb6766141d802133cd5f92b2672f7 Mon Sep 17 00:00:00 2001 From: andrew-eldridge Date: Wed, 29 Apr 2026 14:17:17 -0400 Subject: [PATCH 2/2] add tests --- .../__test__/CreateLogicAppProject.test.ts | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/__test__/CreateLogicAppProject.test.ts b/apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/__test__/CreateLogicAppProject.test.ts index fc43139449e..a9bdfecfcab 100644 --- a/apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/__test__/CreateLogicAppProject.test.ts +++ b/apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/__test__/CreateLogicAppProject.test.ts @@ -14,6 +14,8 @@ import { updateWorkspaceFile, } from '../CreateLogicAppWorkspace'; import { createLogicAppVsCodeContents } from '../CreateLogicAppVSCodeContents'; +import { getAzureConnectorDetailsForLocalProject } from '../../../../utils/codeless/common'; +import { startDesignTimeApi } from '../../../../utils/codeless/startDesignTimeApi'; import { ProjectType } from '@microsoft/vscode-extension-logic-apps'; import type { IActionContext } from '@microsoft/vscode-azext-utils'; import type { IWebviewProjectContext, IProjectWizardContext } from '@microsoft/vscode-extension-logic-apps'; @@ -28,6 +30,8 @@ import * as fse from 'fs-extra'; vi.mock('../../../../utils/funcCoreTools/funcVersion'); vi.mock('../../../../utils/git'); vi.mock('../../../../utils/codeless/artifacts'); +vi.mock('../../../../utils/codeless/common'); +vi.mock('../../../../utils/codeless/startDesignTimeApi'); // Keep these mocked for unit tests, but will unmock for integration tests vi.mock('../CreateFunctionAppFiles'); @@ -105,6 +109,8 @@ describe('createLogicAppProject', () => { (createRulesFiles as Mock).mockResolvedValue(undefined); (createLibFolder as Mock).mockResolvedValue(undefined); (gitInit as Mock).mockResolvedValue(undefined); + (getAzureConnectorDetailsForLocalProject as Mock).mockResolvedValue(undefined); + (startDesignTimeApi as Mock).mockResolvedValue(undefined); }); afterEach(async () => { @@ -263,6 +269,27 @@ describe('createLogicAppProject', () => { expect(vscode.window.showInformationMessage).toHaveBeenCalledWith(expect.stringContaining('Finished creating project')); }); + it('should call getAzureConnectorDetailsForLocalProject on successful creation', async () => { + await createLogicAppProject(mockContext, mockOptions, workspaceRootFolder); + + expect(getAzureConnectorDetailsForLocalProject).toHaveBeenCalledWith(mockContext, logicAppFolderPath); + }); + + it('should call startDesignTimeApi on successful creation', async () => { + await createLogicAppProject(mockContext, mockOptions, workspaceRootFolder); + + expect(startDesignTimeApi).toHaveBeenCalledWith(logicAppFolderPath); + }); + + it('should not call design-time functions when not in a workspace', async () => { + (vscode.workspace as any).workspaceFile = undefined; + + await createLogicAppProject(mockContext, mockOptions, workspaceRootFolder); + + expect(getAzureConnectorDetailsForLocalProject).not.toHaveBeenCalled(); + expect(startDesignTimeApi).not.toHaveBeenCalled(); + }); + it('should set shouldCreateLogicAppProject to false when logic app exists', async () => { // Create a valid logic app structure with proper workflow.json schema await fse.ensureDir(logicAppFolderPath);