using Azure.Monitor.OpenTelemetry.Exporter; using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.Azure.Functions.Worker; using Microsoft.Azure.Functions.Worker.Builder; using Microsoft.Azure.Functions.Worker.OpenTelemetry; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using OpenTelemetry; var builder = FunctionsApplication.CreateBuilder(args); builder.ConfigureFunctionsWebApplication(); if (!string.IsNullOrEmpty(Environment.GetEnvironmentVariable("APPLICATIONINSIGHTS_CONNECTION_STRING"))) { builder.Services.AddOpenTelemetry() .UseFunctionsWorkerDefaults(); //.UseAzureMonitorExporter(); } // Need this to get around request size limits when running locally builder.Services.Configure(options => { options.Limits.MaxRequestBodySize = int.MaxValue; }); builder.Build().Run();