1

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. 1/28/2022 9:25:15 AM - Running job: Release
  2. 1/28/2022 9:25:28 AM - Application 'C:<path to app>' was recycled after detecting app_offline.htm.
  3. 1/28/2022 9:25:29 AM - Application 'MACHINE/WEBROOT/APPHOST//' has shutdown.
  4. 1/28/2022 9:25:33 AM - Job Release completed with result: Succeeded

Where

  1. DevOps Microservice Build - Start
  2. Recycle (build creates the app_offline)
  3. Api Shutdown
  4. 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?

IIS Configuration

enter image description here

Ross Bush
  • 121
  • 5
  • I am thinking that in IIS an http request is required to activate code that starts the application domain and in this case the background worker. – Ross Bush Feb 01 '22 at 03:33

1 Answers1

0

The one thing I was missing was Preload Enabled=true at the IIS application level. That will basically send in a request ton start your app after a recycle due to a deployment or anything else.

Ross Bush
  • 121
  • 5