GerardMartin-7933 avatar image
0 Votes"
GerardMartin-7933 asked MughundhanRaveendran-MSFT commented

Error when trying to start an Azure function on a different port with Visual Studio 2019

Hi, I'm trying to start two functions at the same time with Visual studio, it gives me an error because of the port. I'm using .net 5.0 and function version 3. I tried adding this to the local.settings.json

       "IsEncrypted": false,
       "Values": {
             "AzureWebJobsStorage": "UseDevelopmentStorage=true",
             "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated"
       "Host": {
             "LocalHttpPort": 7073

but it didn't worked, so i searched a bit and found a workarround using the Application Arguments. I tried all sort of combinations with that but i cannot make it work. Here are some of the configs I've tried

start -port 7073
start -p 7073
host start --port 7073 --nodeDebugPort 5860
host start --pause-on-error
host start --port 7073 --pause-on-error
host start --pause-on-error --nodeDebugPort 5860

None of them work since when the functions start i get an error like this one

and in the console i can see this error

Could not execute because the specified command or file was not found.
Possible reasons for this include:
You misspelled a built-in dotnet command.
You intended to execute a .NET program, but dotnet-start does not exist.
* You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

C:\Program Files\dotnet\dotnet.exe (process 20484) exited with code 1.
Press any key to close this window . . .

Any solutions to that i've tried to install .dotnet on the PATH but i got no luck

image.png (5.4 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@GerardMartin-7933 ,

I am able to reproduce this issue at my end. I will check this offline and get back to you with an answer

1 Vote 1 ·

0 Answers