I have a container with .Net console app running in it. It works fine on my mac. When deployed to Azure App Service on Linux, it starts then terminates immediately. It seems to me that Azure App Service on Linux is expecting the container to respond to HTTP pings, but my container is a background service, not a web server, and doesn’t expose any ports. How can I get my dockerized console app to run smoothly in an Azure App Service for Linux?
Should I convert it to a WebHost just to get it to respond to pings?
Should I be using some other type of Azure infrastructure (Container Apps?)
Can I turn off the HTTP pings? (No obvious way in the portal to do so)
Any other thoughts?
Logs look like this.
2024-04-26T19:45:41.663Z INFO - Starting container for site
2024-04-26T19:45:41.663Z INFO - docker run -d -p 4665:8080 --name redactedappname1302_0_61646b2f -e WEBSITE_USE_DIAGNOSTIC_SERVER=false -e WEBSITES_PORT=8080 -e WEBSITE_SITE_NAME=redactedappname1302 -e WEBSITE_AUTH_ENABLED=False -e WEBSITE_ROLE_INSTANCE_ID=0 -e WEBSITE_HOSTNAME=redactedappname1302.azurewebsites.net -e WEBSITE_INSTANCE_ID=2c847a802c8040b33d7df73fac3a50614d8069754a88be4922fa1677ca17ce3d -e HTTP_LOGGING_ENABLED=1 redactedregistryname.azurecr.io/redactedappname:20240426.20.2cf015ff -p 80:8080
2024-04-26T19:45:44.387Z INFO - Initiating warmup request to container redactedappname1302_0_61646b2f for site redactedappname1302
2024-04-26T19:45:49.146Z ERROR - Container redactedappname1302_0_61646b2f for site redactedappname1302 has exited, failing site start
2024-04-26T19:45:49.159Z ERROR - Container redactedappname1302_0_61646b2f didn't respond to HTTP pings on port: 8080, failing site start. See container logs for debugging.
2024-04-26T19:45:49.233Z INFO - Stopping site redactedappname1302 because it failed during startup.