Open paulbatum opened 2 months ago
@satvu figured out that this is related to the use of HttpRequestData in the context of an app that has a program.cs that initializes the ASP.NET integration e.g.
var host = new HostBuilder()
.ConfigureFunctionsWebApplication()
.ConfigureServices(services =>
{
services.AddApplicationInsightsTelemetryWorkerService();
services.ConfigureFunctionsApplicationInsights();
})
.Build();
No repro once I switched the application code over to use HttpRequest:
[Function("Function1_HttpStart")]
public static async Task<MyOutput> HttpStart(
[HttpTrigger(AuthorizationLevel.Anonymous, "get", "post")] HttpRequest req,
FunctionContext executionContext)
{
var body = req.Method switch
{
"GET" => $"Test message: {DateTime.UtcNow}",
"POST" => await new StreamReader(req.Body).ReadToEndAsync(),
_ => throw new NotImplementedException()
};
var response = new OkResult();
return new MyOutput
{
QueueOutput = body,
HttpResponse = response
};
}
public class MyOutput
{
[QueueOutput("myqueue", Connection = "")]
public string QueueOutput { get; set; }
public ActionResult HttpResponse { get; set; }
}
HTTP triggered .NET isolated function that uses an output binding to write to a queue will randomly fail with a 500, with the following exception:
Investigative information
Multiple applications are hitting this error, but its a small number (less than 20 in last day).
Repro steps
Deploy net isolated app with following code and execute the http trigger multiple times.
Repros on both: 4.1035.2.2 4.34.2.2