1

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?

Bartosz
  • 4,406
  • 7
  • 41
  • 80

2 Answers2

0

Try adding an app setting of PORT set to 8600 as well as WEBSITES_PORT.

Marky
  • 269
  • 2
  • 8
-1

App Service only serves traffic on port 80. The WEBSITES_PORT setting allows you to map incoming traffic on port 80 to the port that your container is listening on. Therefore, there is no way to reach your container directly using port 8600.

CSharpRocks
  • 6,791
  • 1
  • 21
  • 27
  • Right, but the first thing I tried is reaching it without specifying the port... and still didn't work. Probably because the app didn't even start up, as per the logs from the AppService. But why won't it start up? I see that the changes in `WEBSITES_PORT` settings impact the messages in the log (e.g. `...HTTP pings on port: 8600...` vs `...HTTP pings on port: 80...`) – Bartosz May 14 '21 at 13:28