azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

LocalHttpPort not honored in VS

Open JohnReeson opened this issue 5 years ago • 13 comments

See the sample of local.settings.json. It says

The --port command-line option takes precedence over this value.

Is it the reason that LocalHttpPort doesn't work in VS(set --port 7071 somewhere by default) , while using the standalone CLI installed by npm it does? Both CLI have the same version.

Azure Functions Core Tools (2.1.748 Commit hash: 5db20665cf0c11bedaffc96d81c9baef7456acb3)
Function Runtime Version: 2.0.12134.0

JohnReeson avatar Oct 24 '18 10:10 JohnReeson

I've just encountered this same issue today, 6 months later, using VS2019.

Echoing the original report that Host:LocalHttpPort setting is ignored by VS when debugging an Azure Function locally. It sticks to using port 7071.

When running from CLI, it correctly uses the user-specified port #.

Curious to know if there is something we should be doing differently when using VS (short of perhaps trying command switches in the project config -> debug -> 'application arguments' ??).

The impact is that presumably, we can't debug multiple concurrent Function projects, because ports will conflict?

Edit: Just to add, I have found mentions of this issue back in June 2017, in this GitHub Discussion

SiliconOrchid avatar Apr 29 '19 18:04 SiliconOrchid

@ColbyTresness can you please track this with VS team?

ahmedelnably avatar Dec 26 '19 22:12 ahmedelnably

Still broken April 2020...

worldspawn avatar Apr 09 '20 04:04 worldspawn

@soninaren Do you know what the problem might be here? Thanks.

anthonychu avatar Apr 09 '20 18:04 anthonychu

wow! since 2018? anybody lives in this repo 😁?

MhAllan avatar Sep 12 '20 09:09 MhAllan

+1. I still can't change the port!!!

tudor33sud avatar Dec 08 '20 12:12 tudor33sud

Same problem here in 2021.

TobiStr avatar Jan 25 '21 10:01 TobiStr

Bump

progala2 avatar May 19 '21 13:05 progala2

@vijayrkn Do you know if VS does anything to override this setting?

anthonychu avatar Dec 14 '21 22:12 anthonychu

interesting.

MhAllan avatar Feb 26 '22 06:02 MhAllan

same issue in March 2022. Still no fix or workaround or idea for this?

tomanizer avatar Mar 19 '22 16:03 tomanizer

@tomanizer

I just came across the same issue. Look under the Properties folder for launchSettings.json . Visual Studio 2022 was overriding the LocalHttpPort in the local.settings.json with the one provided in launchSettings.json

I hope that helps.

c0g1t8 avatar May 28 '22 00:05 c0g1t8

Looks like this problem is recurrurrent 🤔. I found the following as well https://github.com/Azure/Azure-Functions/issues/584#issuecomment-343529583

c0g1t8 avatar May 28 '22 05:05 c0g1t8