Skip to content

Azure Functions project fails to start when IDE cannot handle "azure-functions" launch type — DCP fallback runs bare dotnet with no arguments #16997

Description

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When an Azure Functions project is added via AddAzureFunctionsProject<T>() and the AppHost is launched in debug mode from VS Code without the Azure Functions extension installed, the Functions resource fails immediately with:

2026-05-12T22:31:56 Usage: dotnet [path-to-application]
2026-05-12T22:31:56 Usage: dotnet [commands]

<remainder of basic dotnet.exe help>

 [sys] run session could not be started: IDE returned a response indicating failure: Error = run session could not be started: IDE returned unexpected status code for Executable run request: 500 Internal Server Error
 [sys] An attempt to start the Executable failed: Error = the reason for the Executable startup failure is unknown
[sys] Starting process...: Cmd = C:\Program Files\dotnet\dotnet.exe, Args = []

There is no useful feedback to the developer as to why the failure happened ("the reason for the Executable startup failure is unknown") or what to do to fix it.

DCP attempts ExecutionType.IDE with the "azure-functions" launch configuration type, but when the IDE doesn't handle that type, DCP falls back to ExecutionType.Process. The fallback runs dotnet with zero arguments because run --project <path> args are only populated in the non-debug else branch of PrepareProjectExecutables() in ExecutableCreator.cs.

The first two branches (SupportsDebugging == true and ShouldFallBackToIdeExecution) set FallbackExecutionTypes = [Process] but leave projectArgs empty, assuming the IDE will handle launching. When the IDE can't handle "azure-functions", the fallback inherits empty args.

Expected Behavior

When DCP falls back from IDE to Process execution for an "azure-functions" launch type, it should construct valid process arguments (e.g. dotnet run --project <path>) so the Functions project can start without IDE-assisted launching.

It should also perhaps detect and produce warnings about the missing VS code extension if at all possible.

Steps To Reproduce

  1. Create an Aspire AppHost with an Azure Functions isolated worker project using FunctionsApplication.CreateBuilder(args)
  2. Use AddAzureFunctionsProject<T>("functions") in AppHost.cs
  3. Open in VS Code with C# Dev Kit (without Azure Functions extension)
  4. Press F5 (Start Debugging) on the AppHost
  5. Observe the Functions resource immediately exits with dotnet CLI usage help

Workaround: Run without debugging (Ctrl+F5) or dotnet run from terminal.

Exceptions (if any)

No response

Aspire doctor output

No response

Anything else?

  • .NET SDK: 10.0.203
  • IDE: VS Code with C# Dev Kit
  • OS: Windows 11
  • Aspire: 13.2.4
  • Azure Functions Worker SDK: 2.0.4
  • azure-functions-core-tools: 4.10.0

Relevant source:

  • ExecutableCreator.cs — PrepareProjectExecutables()
  • AzureFunctionsProjectResourceExtensions.cs — WithDebugSupport(..., "azure-functions")

Activity

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

Metadata

Metadata

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions