internal class Startup : FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
var configuration = builder.GetContext().Configuration;
var dependencyContext = DependencyContext.Load(typeof(Startup).Assembly);
ConfigureSerilog(builder.Services, configuration, "AzureFunctionsJobHost:Serilog", dependencyContext);
}
private static void ConfigureSerilog(IServiceCollection services, IConfiguration configuration, string sectionName,
DependencyContext dependencyContext)
{
var config = new LoggerConfiguration().ReadFrom.Configuration(configuration, sectionName, dependencyContext);
Log.Logger = config.CreateLogger();
services.AddSingleton<ILoggerProvider>(_ => new SerilogLoggerProvider(dispose: true));
services.AddSingleton<ILoggerFactory>(_ => new SerilogLoggerFactory(dispose: true));
}
}
Publish errors
23/12/2022 05:44:45
System.AggregateException: One or more errors occurred. ---> Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
--- End of inner exception stack trace ---
---> (Inner Exception #0) Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details. <---
Microsoft.WebTools.Shared.Exceptions.WebToolsException: Publish has encountered an error. We were unable to determine the cause of the error. Check the output log for more details.
host.json
Startup.cs
Publish errors