Hosted Service scope when running as Azure Web Job
Working on a BackgroundService that is published to Azure as a Web Job, I noticed something strange (works fine on Azure, exception when running locally), so I tried to recreate the situation. Program.cs: using TestBackgroundJob; IHost host = Host.CreateDefaultBuilder(args) .ConfigureServices(services => { services.AddScoped<IDummyService, DummyService>(); services.AddHostedService<Worker>(); }) .Build(); await host.RunAsync(); Worker public class Worker : BackgroundService… Read More Hosted Service scope when running as Azure Web Job