Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use next available port when the default port is already used #2682

Open
wants to merge 3 commits into
base: v3.x
Choose a base branch
from

Conversation

PramodValavala-MSFT
Copy link
Contributor

When working with multiple function apps locally, every function host apart from the first needs to have a different port manually set either via the command line argument --port or the Host.LocalHttpPort property in local.settings.json. Also, in some cases the default port might be blocked with another process (sometimes an older func itself that didn't terminate).

This PR adds support to pick up the next available port (7072, 7073, ...) when none is provided. If a port is defined in either place mentioned above, this would not do anything.

One known issue is that multiple function apps run at the exact same time might end up picking the same port, causing one of them to error out. This is present even today with the static default port, primarily because the validation is done before the host starts up.

@kshyju kshyju self-assigned this Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants