In old ASP.NET, in the Global.asax.cs class, I would log when the app starts, stops and throws unhandled exceptions:
Application_Start()
Please see CaptureStartupErrors and the method .CaptureStartupErrors(true) that will help you find issues.
This is especially handy when something runs perfect on localhost but fails in Azure.
Here is my usual config for NetCore Web Apps:
public static IWebHost BuildWebHost(string[] args) => WebHost
.CreateDefaultBuilder(args)
.CaptureStartupErrors(true)
.UseKestrel()
.UseIISIntegration()
.UseStartup()
.UseAzureAppServices()
.Build();
In Azure App Service you can then find the logs in the log stream in Kudu Tools https://