First of all, I am aware that there are a few similar questions and I have tried the suggestions in the answers provided, but it did not help.
I have an ASP.NET Core web app running as a Linux container. Locally the app builds and runs fine. When deployed to Azure, the app fails to start up and I can see the following error:
- Container mytestapp_0_560a15e8 for site mytestapp did not start within expected time limit. Elapsed time = 230.4559912 sec
- Container mytestapp_0_560a15e8 didn't respond to HTTP pings on port: 8600, failing site start. See container logs for debugging.
- Stopping site mytestapp because it failed during startup. -ERROR - Container mytestapp_0_74c5b4f4 for site mytestapp did not start within expected time limit. Elapsed time = 1800.0389751 sec
(Notice I tried increasing the WEBSITES_CONTAINER_START_TIME_LIMIT
to maximum value (after reading this) and I did set the WEBSITES_PORT
settings to use 8600 instead of default 80 after reading this and this)
My dockerfile exposes port 8600 as below:
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine
ARG port
WORKDIR /app
EXPOSE ${port:-8600}
and it seems to run OK
- docker run -d -p 8266:8600 --name mytestapp_0_560a15e8 -e WEBSITES_ENABLE_APP_SERVICE_STORAGE=false -e WEBSITES_PORT=8600 -e WEBSITE_SITE_NAME=mytestapp -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=mytestapp.azurewebsites.net -e WEBSITE_INSTANCE_ID=cb8d91c9d2a29a2894b5445bbfe9d306e91eb996b4b7cdada5ff30dc3f2bfdda -e HTTP_LOGGING_ENABLED=1 myregistry.azurecr.io/lc-mytestapp-addon:1.2.59
One more thing that I tried is that when I expose port 80 in the dockerfile (and disable the WEBSITES_PORT
setting in Azure), the app runs OK.
Am I doing anything wrong with the exposure of port 8600, or is it just a limitation that I have to live with?