Since friday my grpc service has been restarting constantly saying my port 8080 is already in use. It was working fine until friday and no update was made in my code.
builder.WebHost.ConfigureKestrel(options =>
{
// Comment out for local development, uncomment when publishing to App Service
options.ListenAnyIP(8080);
options.ListenAnyIP(9000, listenOptions =>
{
listenOptions.Protocols = HttpProtocols.Http2;
});
options.ListenAnyIP(9001, listenOptions =>
{
listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
});
});
This is my configuration of kestrel. I have tried commenting out the port 8080. In my appsettings.json the kestrel part has also been commented out.
This has been reported a couple of places online, but yet a solution is missing...
has anyone fixed this, and how?
Found the solution...
https://github.com/Azure/app-service-linux-docs/issues/149
I removed the reflection services and the ListenAnyIp() in my code..
Should work for both .net 6 and .net 7...
Make sure you restart the web app afterwards.. not just by restarting, but by going to "Diagnose and solve problems" and search for "advanced application restart"... my service is up and running again...