Skip to content

Comments

Respect Java remote debugging setting precedence when both debug modes are enabled#4901

Open
Copilot wants to merge 3 commits intomainfrom
copilot/fix-remote-debugging-issue
Open

Respect Java remote debugging setting precedence when both debug modes are enabled#4901
Copilot wants to merge 3 commits intomainfrom
copilot/fix-remote-debugging-issue

Conversation

Copy link
Contributor

Copilot AI commented Jan 28, 2026

When both enableRemoteDebugging and enableJavaRemoteDebugging settings are enabled, invoking "Start Remote Debugging" on a Java function app fails with a Node.js-specific error instead of delegating to the Java debugging flow.

Changes

Modified startRemoteDebug() to check runtime and delegate to Java debugging when appropriate:

// Check if Java remote debugging is enabled and if this is a Java function app
const isJavaRemoteDebuggingEnabled: boolean = !!getWorkspaceSetting<boolean>('enableJavaRemoteDebugging');
if (isJavaRemoteDebuggingEnabled) {
    const appSettings: StringDictionary = await siteClient.listApplicationSettings();
    const workerRuntime: string | undefined = appSettings.properties?.[workerRuntimeKey];

    // If this is a Java app, delegate to Java remote debugging
    if (workerRuntime?.toLowerCase() === 'java') {
        return await remoteDebugJavaFunctionApp(context, node);
    }
}

This ensures Java function apps use the Java debugging flow (which prompts for configuration changes) rather than failing with the Node.js-only error message.

Original prompt

This section details on the original issue you should resolve

<issue_title>Fail to execute "Start Remote Debugging" action for Java function app</issue_title>
<issue_description>OS: Win11
Build Version: 20251218.1

Repro Steps:

  1. Enable the setting "Azure Functions: Enable Java Remote Debugging" and "Azure Functions: Enable Remote Debugging".
  2. Right click one Java function app -> Select "Start Remote Debugging".
  3. Check whether a confirmation dialog pops up.

Expect:
A confirmation dialog pops up.
Image

Actual:
An error occurs.
Image

More Info:

  1. Just enable setting "Azure Functions: Enable Java Remote Debugging", the action "Attach Debugger" instead of "Start Remote Debugging" appears.
  2. Just enable setting "Azure Functions: Enable Remote Debugging", the action "Start Remote Debugging" appears.
    </issue_description>

Comments on the Issue (you are @copilot in this section)

@motm32 We want to always respect the "Azure Functions: Enable Java Remote Debugging" over the "Azure Functions: Enable Remote Debugging" if it is a Java app and both settings are enabled.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Fix error when starting remote debugging for Java function app Respect Java remote debugging setting precedence when both debug modes are enabled Jan 28, 2026
Copilot AI requested a review from motm32 January 28, 2026 19:29
@motm32 motm32 marked this pull request as ready for review February 3, 2026 21:56
@motm32 motm32 requested a review from a team as a code owner February 3, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fail to execute "Start Remote Debugging" action for Java function app

3 participants