I have an azure function whose startup looks like this
internal class Startup : FunctionsStartup
{
public override void ConfigureAppConfiguration(IFunctionsConfigurationBuilder builder)
{
}
public override void Configure(IFunctionsHostBuilder builder)
{
builder.Services.SomeExtensionMethod();// This will add few services to the service collection.
}
}
Consider multiple functions under a function app with this as the startup. Let one of the registered services in the builder.Services.SomeExtensionMethod()
be IBootstrapService
. Now I want to run a method in IBootstrapService
right after the startup executes. Is there a way I can do this, since azure functions doesn't support IHostedService. I cannot go with isolated function apps because I have a lot of in-process functions which I need to migrate.