gRPC App in App Service startup. Port 8080 already in use

James 25 Reputation points
2023-01-20T14:12:11.09+00:00

Since late last night my web app has started failing to load due to port 8080 already being in use. I have destroyed the app and recreated it, but whenever I deploy my code, the logs state

Failed to bind to address http://[::]:8080: address already in use.

It's a gRPC App on a Linux App Service, using the code within the tutorial (see below)

How to get this working again? Everything was fine until last yesterday

builder.WebHost.ConfigureKestrel(options => {
    options.ListenAnyIP(8080);    
    options.ListenAnyIP(8585, listenOptions => { 
        listenOptions.Protocols = HttpProtocols.Http2;    
    });
});
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,832 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Marius Žydelis 20 Reputation points
    2023-01-25T15:06:11.2266667+00:00

    I found a solution at least for my issue, might be related. This explains the issue and the solution:

    https://github.com/Azure/app-service-linux-docs/issues/149

    Weirdly this is for .net7 solution, but it solves with .net6 as well.

    2 people found this answer helpful.

  2. Grmacjon-MSFT 15,441 Reputation points
    2023-01-27T01:13:56.13+00:00

    Hi everyone,

    Thanks again for your patience. We apologies for the inconvenience this issue may have caused.

    Adding more context to the solution Marius shared: the engineering team confirmed that there was an update for .NET 6 which removed the need for using the code sample James shared in his question. The documentation has been updated to reflect this change. You can now view the updated doc here: app-service-linux-docs/use_gRPC_with_dotnet.md at master · Azure/app-service-linux-docs (github.com)

    Hope that helps. Please let us know if you have any other questions.

    Best,

    Grace