FeedDataverseBQ/AzureFunction/Program.cs

25 lines
771 B
C#
Raw Normal View History

2025-03-24 09:45:46 -04:00
using Microsoft.Azure.Functions.Worker;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
2025-03-24 16:14:46 -04:00
using Migration.Services;
2025-03-24 09:45:46 -04:00
using OSAFeedXML;
var host = new HostBuilder()
.ConfigureFunctionsWorkerDefaults()
.ConfigureServices(services =>
{
services.AddApplicationInsightsTelemetryWorkerService();
services.ConfigureFunctionsApplicationInsights();
services.AddSingleton<IBigQuery, GoogleBigQuery>();
2025-03-24 16:14:46 -04:00
services.AddSingleton<IGoogleBigQueryClientFactory, GoogleBigQueryClientFactory>();
services.AddSingleton(sp =>
{
var factory = sp.GetRequiredService<IGoogleBigQueryClientFactory>();
return factory.CreateClient();
});
2025-03-24 09:45:46 -04:00
})
.Build();
host.Run();