I have configured an pool to auto-start and never sleep. I am having problems with the auto-start. My understanding is that a thread pool worker will be started after a recycle when that happens I would assume the application entry point would be called, however, that does not seem to be working.
When the application is deployed, I see the following log entries under the "IIS AspNetCore Modeule" V2 sink.
- 1/28/2022 9:25:15 AM - Running job: Release
- 1/28/2022 9:25:28 AM - Application 'C:<path to app>' was recycled after detecting app_offline.htm.
- 1/28/2022 9:25:29 AM - Application 'MACHINE/WEBROOT/APPHOST//' has shutdown.
- 1/28/2022 9:25:33 AM - Job Release completed with result: Succeeded
Where
- DevOps Microservice Build - Start
- Recycle (build creates the app_offline)
- Api Shutdown
- DevOps Microservice Build Start - Succeeded
I am puzzled that there is not a associated api startup message such as - Application 'C:<path to app>' started successfully.
It is important to note that this a .NET Core API "microservice" that does not take any http requests. In code, the startup has this configuration.
services.AddHostedService<AuthorizationMessageConsumerService>();
and
public class AuthorizationMessageConsumerService : BackgroundService
If after every deployment, the /health endpoint is pinged then the service starts up.
I can only guess that AlwaysRunning just created a new request thread but does not call any entry point, which gets called by an incoming http request /health.
I am trying to avoid making a ping a build and deployment requirement. Are there any options or would setting up health pings on timed intervals and post deployment be the best solution?