I have a containerized a console app which run as a scheduler app and performe some logic at specific time. I tried to run it as an Azure App service but getting below error
2022-03-30T19:10:29.209Z INFO - Waiting for response to warmup request for container one-site-scheduler-app_0_d429ab9d. Elapsed time = 209.8994308 sec
2022-03-30T19:10:45.377Z INFO - Waiting for response to warmup request for container one-site-scheduler-app_0_d429ab9d. Elapsed time = 226.067164 sec
2022-03-30T19:10:49.746Z ERROR - Container scheduler-app_0_d for site one-site-scheduler-app did not start within expected time limit. Elapsed time = 230.4276536 sec
2022-03-30T19:10:49.901Z ERROR - Container scheduler-app_0_d didn't respond to HTTP pings on port: 80, failing site start. See container logs for debugging.
2022-03-30T19:10:49.977Z INFO - Stopping site scheduler-app because it failed during startup.
Although before it stops the container I see the logs from the scheduler app.
I am not sure what am I missing here.
this article but no luck.
I learn that Azure app service pings on port 80 by default to check if it gets any response, since my container just ran a console application it never responded to the ping from the app service. To fix that I converted my console app to a single point web app using webhostbuilder and followed the steps from the below, https://nitishkaushik.com/what-is-webhostbuilder-in-asp-net-core/
This trick worked.