Azure / Azure/azure-functions-core-tools

Clean concurrent local execution

Open
#2,492 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
5d 4h
Merged PRs (30d)
15

Description

This is general feedback.

I have multiple functions projects in the same solution, and it would be great if there were a way to run the functions host concurrently in a clean way.

Problems with the current dotnet/func tooling that I walked through tonight:

- There's no `func watch`. OK, there's a workaround in #1239 and it seems to work well enough.
- MSBuild can't be run in parallel, and some of my functions share library references in the same solution. So I get `The process cannot access the file ... because it is being used by another process.` from msbuild. So I add `--no-build` to the `func` invocation. Watching probably won't work with that flag, but at least I can run them in `concurrently` and restart manually.
- Turns out no. `--no-build` causes a `No job functions found.` error from the host. All Google answers are quite old but recommend running from the output directory.
- So I give a `WorkingDirectory` of `$(OutputPath)` to the `Target` `Exec`, and that works.

Remaining problems:

1. It's not actually a "watch" (it won't rebuild automatically).
2. There's no way to get a watch going. The `dotnet-watch` approach won't work with multiple function apps.
1. There are eleven zombie (parentless) `dotnet.exe` and `conhost.exe` processes created. I'm not entirely sure where these processes are coming from. But when I kill `concurrently` and restart, the zombie processes are reused (?), so at least they don't grow over time.

Conclusion: Running multiple functions locally with a single command (and ideally in the same console window a la [`concurrently`](https://www.npmjs.com/package/concurrently)) is just way harder than it needs to be.

Contributor guide

Open the contributing guide

Research direction

The issue names the func invocation, --no-build, WorkingDirectory, MSBuild, dotnet-watch, and concurrently, but no source file or test. Start by reproducing concurrent local function execution and inspect how the CLI launches hosts and handles their processes. Done would provide a single clean command for concurrent watch/rebuild execution without zombie processes.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
build-system, cli, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.