Under ASP.NET Core Sidekick should be launched only when the Host Application is fully started, i.e. when the Kestrel port is opened and the full middleware pipeline is initialized.
Actual Behavior
Sidekick currently starts Dapr Sidecar asynchronously using an IHostedService, which means it is started before the ASP.NET GenericWebHostService hosted service is started to initialize the middleware pipeline and open the host port. This means any environment variables or initialization properties set during the middleware construction may not be passed to the Dapr Sidecar, resulting in potentially missing metadata entries in Consul or anywhere else that relies on environment variables in the yaml files.
We should instead wait until IHostApplicationLifetime.ApplicationStarted signals the application has started before starting the Sidecar process.
Steps to Reproduce the Problem
N/A
Release Note
RELEASE NOTE: FIX Delay Sidecar Startup until Host Application Started
Expected Behavior
Under ASP.NET Core Sidekick should be launched only when the Host Application is fully started, i.e. when the Kestrel port is opened and the full middleware pipeline is initialized.
Actual Behavior
Sidekick currently starts Dapr Sidecar asynchronously using an
IHostedService
, which means it is started before the ASP.NETGenericWebHostService
hosted service is started to initialize the middleware pipeline and open the host port. This means any environment variables or initialization properties set during the middleware construction may not be passed to the Dapr Sidecar, resulting in potentially missing metadata entries in Consul or anywhere else that relies on environment variables in the yaml files.We should instead wait until
IHostApplicationLifetime.ApplicationStarted
signals the application has started before starting the Sidecar process.Steps to Reproduce the Problem
N/A
Release Note
RELEASE NOTE: FIX Delay Sidecar Startup until Host Application Started