I recently updated my .NET 7 app to .NET 8 and deployed it to my web app (Linux). After deployment I am getting this error:
🙁 Application Error
If you are the application administrator, you can access the diagnostic resources.
I got the logs from the Log stream and here was the issue.
2023-11-16T12:06:46.592Z INFO – Initiating warmup request to container octufit-api-dev-1_0_36440c88 for site octufit-api-dev-1
2023-11-16T12:06:48.667Z ERROR – Container octufit-api-dev-1_0_36440c88 for site octufit-api-dev-1 has exited, failing site start
2023-11-16T12:06:48.754Z ERROR – Container octufit-api-dev-1_0_36440c88 didn’t respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2023-11-16T12:06:48.785Z INFO – Stopping site octufit-api-dev-1 because it failed during
I have tried to add PORT 8080 and WEBSITES_PORT 8080 in application settings but nothing is working.
Any help will be appreciated.
2
Answers
I think you moved to fast to .NET 8. They just published an article on November 14, 2023 – ".NET 8 GA available on App Service". They say that:
so you better wait for them (at least November 19, 2023) to fully configure/setup the environments.
The author said he did this, and it didn’t work, but this did work for us. Just posting this here for posterity. We were at a loss as to why our new container on .NET 8 didn’t work in our app service. It was the port change that was the issue. Per the docs
Note: ASP.NET Core apps (in official images) listen to port 8080 by default, starting with .NET 8.
You need to set the WEBSITES_PORT appsetting to 8080 in your App Service. This will make your app service run
docker run -d --expose=8080
when running your image as a container and have your app service route requests to it.Here’s the az command for reference if you want to use it: