Skip to content

fix(vscode): auto-enable multi-language worker for JDBC connector (#8597) - #9442

Open
Carlos Castro Trejo (ccastrotrejo) wants to merge 5 commits into
Azure:mainfrom
ccastrotrejo:ccastrotrejo-microsoft-investigate-issue-8597
Open

fix(vscode): auto-enable multi-language worker for JDBC connector (#8597)#9442
Carlos Castro Trejo (ccastrotrejo) wants to merge 5 commits into
Azure:mainfrom
ccastrotrejo:ccastrotrejo-microsoft-investigate-issue-8597

Conversation

@ccastrotrejo

@ccastrotrejo Carlos Castro Trejo (ccastrotrejo) commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Commit Type

  • feature - New functionality
  • fix - Bug fix
  • refactor - Code restructuring without behavior change
  • perf - Performance improvement
  • docs - Documentation update
  • test - Test-related changes
  • chore - Maintenance/tooling

Risk Level

  • Low - Minor changes, limited scope
  • Medium - Moderate changes, some user impact
  • High - Major changes, significant user/system impact

What & Why

Fixes #8597. Using the JDBC built-in connector in a local Standard Logic App failed with "JDBC client library is missing" even when the driver JAR (for example, ojdbc8.jar) was correctly placed in lib/builtinOperationSdks/JAR.

The JDBC connector is a Java built-in operation that only runs when the Functions multi-language Java worker is enabled via the app setting AzureWebJobsFeatureFlags=EnableMultiLanguageWorker. The extension only wrote that flag for customCode, rulesEngine, and codeful project types, so a plain codeless Logic App never got it and the Java worker never started locally. This is why it works in the Portal/Kudu, where the runtime is already provisioned, but not in VS Code.

This change makes the tooling self-heal the prerequisite instead of requiring users to discover it by trial and error:

  • Auto-enable the worker: on design-time startup, when driver JARs are detected in lib/builtinOperationSdks/JAR, EnableMultiLanguageWorker is merged into local.settings.json. The merge preserves existing flags and is idempotent, so it does not clobber user values.
  • JDK guidance: the JDBC connector also needs a locally installed JDK. When driver JARs are present but no Java runtime is found on PATH, a non-blocking warning with a "Learn more" link to the connector docs is shown, so the prerequisite is clear up front.

The JAR-detection, flag-merge, and Java-runtime checks live in app/utils/java/jdbcConnector.ts so they are easy to test and reuse. createLibFolder was also updated to reuse the new folder-name constants with no behavior change.

Impact of Change

  • Users: Local JDBC connections now work after dropping the driver JAR into lib/builtinOperationSdks/JAR and reopening the designer, with clear guidance when a JDK is missing. No manual local.settings.json edit is required.
  • Developers: Adds app/utils/java/jdbcConnector.ts helpers (hasJdbcDriverJars, mergeMultiLanguageWorkerFlag, isJavaRuntimeInstalled, warnIfJdbcJavaRuntimeMissing) and new builtinOperationSdksFolderName, jarFolderName, and jdbcConnectorDocsUrl constants.
  • System: The multi-language worker is only enabled when driver JARs are present, so projects that never use Java are unaffected. Because this ships in the VS Code extension and can update local runtime settings, the PR is classified as Medium risk.

Test Plan

  • Unit tests added/updated
  • E2E tests added/updated
  • Manual testing completed
  • Tested in: pnpm run test:extension-unit (jdbcConnector 19 tests, validateProjectArtifacts 56 tests including 4 new tests, CreateLogicAppWorkspace 83 tests) all passing; E2E integration suite type-checks via tsc -p tsconfig.e2e.json; Biome clean; changed files type-check clean.

New coverage:

  • app/utils/java/__test__/jdbcConnector.test.ts - JAR detection (casing, empty folder, non-JAR files, missing folder), flag merge (empty, idempotent, preserve, dedupe, whitespace), Java runtime check, and warning flow.
  • validateProjectArtifacts.test.ts - self-heal branches (add, merge without clobbering, idempotent, no-op when no JARs).
  • test/e2e/integration/jdbcConnectorPrerequisites.test.ts - real on-disk contract for the self-heal.

Contributors

Root cause and prerequisites corroborated by community findings on the issue thread (Matt Milner (@mnmilner)).

Screenshots/Videos

N/A - no visual UI changes.

Closes #8597

…ure#8597)

The JDBC built-in connector runs on the Functions multi-language (Java)
worker, gated by AzureWebJobsFeatureFlags=EnableMultiLanguageWorker. A
plain codeless Logic App never received that flag, so a driver JAR placed
in lib/builtinOperationSdks/JAR was never loaded locally and connections
failed with "JDBC client library is missing".

- Self-heal on design-time startup: when driver JAR(s) exist, merge
  EnableMultiLanguageWorker into local.settings.json (preserving any
  existing flags) in regenerateLocalSettings.
- Warn (non-blocking, with docs link) when JDBC JARs are present but no
  local Java runtime (JDK) is found.
- Add jdbcConnector util (JAR detection, flag merge, Java runtime check).
- Unit + integration tests for all branches and edge cases.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 72cac36b-47ce-4d10-a368-b71fddfca967
Copilot AI review requested due to automatic review settings July 21, 2026 21:22
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🤖 AI PR Validation Report

PR Review Results

Thank you for your submission! Here's detailed feedback on your PR title and body compliance:

PR Title

  • Current: fix(vscode): auto-enable multi-language worker for JDBC connector (#8597)
  • Issue: None — uses a valid fix(scope): prefix and is specific and descriptive.
  • Recommendation: No change needed.

Commit Type

  • Exactly one type selected: fix — matches the bug-fix nature of the change.
  • No overloading detected.

Risk Level

  • Medium selected in the body and the risk:medium label is present — both match. This ships in the VS Code extension (apps/vs-code-designer) and mutates local runtime settings (local.settings.json), which per the rubric is Medium (extension distribution + runtime settings). Advised estimate: medium — matches the declared level.

What & Why

  • Current: Clear root-cause explanation (multi-language Java worker flag never written for codeless apps) plus the self-heal + JDK-guidance approach.
  • Issue: None.
  • Recommendation: No change needed.

Impact of Change

  • All three audiences are addressed.
  • Recommendation:
    • Users: Local JDBC connections work after dropping the driver JAR and reopening the designer; clear JDK guidance.
    • Developers: New jdbcConnector.ts helpers and folder/URL constants documented.
    • System: Worker only enabled when driver JARs present; non-Java projects unaffected.

Test Plan

  • Both unit tests (jdbcConnector.test.ts, localSettings.test.ts, projectFilesConsistency.test.ts) and an E2E integration suite (jdbcConnectorPrerequisites.test.ts) are added and confirmed in the diff. Strong coverage of detection, merge, idempotency, and warning flow.

⚠️ Contributors

  • Community contributor credited (Matt Milner (@mnmilner)). Consider tagging any PMs/designers/reviewers involved if applicable.

Screenshots/Videos

  • Marked N/A. The diff touches only apps/vs-code-designer logic/tests (no designer-ui/designer/vs-code-react UI components), so no screenshot is required.

Summary Table

Section Status Recommendation
Title No change needed
Commit Type No change needed
Risk Level Medium is correct
What & Why No change needed
Impact of Change No change needed
Test Plan No change needed
Contributors ⚠️ Optionally credit reviewers/PMs
Screenshots/Videos N/A — no visual change

All required checks pass. This PR is compliant with the team template and cleared to merge. Nice work on the thorough tests and clear root-cause writeup.


Powered by: Copilot CLI (claude-opus-4.8) | Last updated: Mon, 03 Aug 2026 15:11:07 GMT

@ccastrotrejo Carlos Castro Trejo (ccastrotrejo) added risk:medium Medium risk change with potential impact and removed needs-pr-update labels Jul 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the VS Code Logic Apps (Standard) extension to automatically satisfy JDBC built-in connector prerequisites for local projects by enabling the Functions multi-language (Java) worker when JDBC driver JARs are detected, and by warning users when Java isn’t installed.

Changes:

  • Added a focused JDBC/Java utility (jdbcConnector.ts) for JAR detection, feature-flag merging, Java runtime probing, and a non-blocking warning flow.
  • Updated codeless project artifact regeneration to self-heal AzureWebJobsFeatureFlags by merging in EnableMultiLanguageWorker when JDBC driver JARs exist.
  • Added unit + e2e integration coverage for the self-heal and warning behavior; centralized folder-name constants and added a missing localized tooltip string.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Localize/lang/strings.json Adds a localized tooltip string for when workflow runtime is unavailable.
apps/vs-code-designer/src/constants.ts Adds constants for JDBC SDK folder names and the JDBC prerequisites docs URL.
apps/vs-code-designer/src/app/utils/java/jdbcConnector.ts New helper utilities for JDBC driver detection, flag merge, Java runtime check, and warning UX.
apps/vs-code-designer/src/app/utils/codeless/validateProjectArtifacts.ts Implements the JDBC feature-flag self-heal during local.settings regeneration.
apps/vs-code-designer/src/app/utils/codeless/startDesignTimeApi.ts Triggers a non-blocking warning when JDBC JARs are present but Java is missing.
apps/vs-code-designer/src/app/utils/java/test/jdbcConnector.test.ts Unit tests for JAR detection, flag merge, Java runtime check, and warn flow.
apps/vs-code-designer/src/app/utils/codeless/test/validateProjectArtifacts.test.ts Adds tests validating the new self-heal branch behavior.
apps/vs-code-designer/src/test/e2e/integration/jdbcConnectorPrerequisites.test.ts New filesystem-contract integration test for the self-heal behavior.
apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/CreateLogicAppWorkspace.ts Uses the new constants when creating the JDBC driver JAR folder in lib/.

@andrew-eldridge

Copy link
Copy Markdown
Contributor

thanks for fixing this one Carlos Castro Trejo (@ccastrotrejo) - I can take care of the conflicts to reconcile with recent changes to project consistency checks

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

apps/vs-code-designer/src/app/utils/java/jdbcConnector.ts:45

  • hasJdbcDriverJars currently treats any directory entry whose name ends with .jar as a driver, even if it’s a folder (e.g., a user-created drivers.jar/ directory). That can incorrectly self-heal AzureWebJobsFeatureFlags and trigger the missing-JDK warning when no actual driver JAR file exists.

Consider verifying the matched entry is a regular file (e.g., await fse.stat(path.join(jarFolder, entry)) and isFile()), ignoring stat errors, and returning true on the first matching file.

export async function hasJdbcDriverJars(projectPath: string): Promise<boolean> {
  const jarFolder = getJdbcDriverJarFolder(projectPath);
  try {
    const entries: string[] = await fse.readdir(jarFolder);
    return entries.some((entry) => entry.toLowerCase().endsWith('.jar'));
  } catch {

…t-investigate-issue-8597

# Conflicts:
#	apps/vs-code-designer/src/app/commands/createNewCodeProject/CodeProjectBase/CreateLogicAppWorkspace.ts
#	apps/vs-code-designer/src/app/projectConsistency/__test__/projectFilesConsistency.test.ts
#	apps/vs-code-designer/src/app/projectConsistency/projectFilesConsistency.ts
#	apps/vs-code-designer/src/app/utils/codeless/startDesignTimeApi.ts
The merge commit's pre-commit lint-staged hook applied eslint/biome
auto-fixes (consistent-type-imports, trailing-whitespace strips, line
reflows) to files pulled in from origin/main, adding churn unrelated to
the JDBC fix. Restore those files to their exact origin/main content and
re-apply only the JDBC self-heal to projectFilesConsistency so this PR's
diff is limited to the JDBC connector change.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 72cac36b-47ce-4d10-a368-b71fddfca967
…ngs generator

Addresses PR review feedback: generateLocalSettingsJson is the single
source of truth for local.settings.json content, so it now owns whether
EnableMultiLanguageWorker belongs in the baseline via an optional
hasJdbcDriverJars signal.

The async disk probe stays in ensureLocalSettingsFile so the generator
remains synchronous (avoiding a breaking change for all other callers),
and the repair path keeps merging with existing user-defined flags so
custom values are never clobbered.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 72cac36b-47ce-4d10-a368-b71fddfca967
// merges it with any user-defined flags so existing values are never clobbered.
if (hasJdbcDrivers) {
const currentFlags = currentValues[azureWebJobsFeatureFlagsKey] ?? settingsToAdd[azureWebJobsFeatureFlagsKey];
const mergedFlags = mergeMultiLanguageWorkerFlag(currentFlags);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mergeMultiLanguageWorkerFlag seems like it should be applied in more than just the JDBC scenario, would this always be relevant if azureWebJobsFeatureFlagsKey is in currentValues and settingsToAdd? Other than this lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-validated risk:medium Medium risk change with potential impact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to use JDBC built-in connector within VS COde

3 participants