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

Gerard Martin 21 Reputation points
2021-10-22T08:12:08.423+00:00

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
![142852-image.png]1

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

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,188 questions
{count} votes