0

I am running Azure Function locally on an Ubuntu machine using VSCode Azure Function Extension.

I created a local function, which runs on the default port 7071.

When checking the the log however, I notice the following message indicating that another port is being used

info: Microsoft.AspNetCore.Hosting.Diagnostics[1]
      Request starting HTTP/2 POST http://127.0.0.1:34447/AzureFunctionsRpcMessages.FunctionRpc/EventStream application/grpc

The port used here 34447 keeps changing every time I run my function. It seems that the ports selected are in the range 3xxxx to range 4xxxx.

I am wondering how is the port is being selected? Is it customizable?

Abdelrahman Shoman
  • 2,882
  • 7
  • 36
  • 61
  • 1
    As per `AzureFunctionsRpcMessages` search in [azure-functions-core-tools](https://github.com/Azure/azure-functions-core-tools/search?q=AzureFunctionsRpcMessages&type=issues) GitHub repo, port range seems random, e.g. `53520`, `55884`, `9550` – Ecstasy Apr 20 '22 at 11:22
  • 1
    You can refer to one of the open issues [Make it more obvious 7071 is the default port](https://github.com/Azure/azure-functions-core-tools/issues/2963) and also open an new issue for further clarification or wait for other community members' response. – Ecstasy Apr 20 '22 at 11:24
  • 1
    The only pattern I could spot is that the Ports range seems to be in the Registered Ports range (1024 to 49151) – Abdelrahman Shoman Apr 21 '22 at 07:48
  • 1
    In case anyone is interested, I opened an issue here https://github.com/Azure/azure-functions-core-tools/issues/3032 – Abdelrahman Shoman Apr 21 '22 at 07:50

0 Answers0