thinkrethink.net
Application Shutdown in ASP.NET Core with IApplicationLifetime
Learn how to gracefully handle Application Shutdown in ASP.NET Core by looking at the handling of flushing the application insights messages when asp.net core exits