Blog Post
Logic Apps Standard custom code now supports .NET 10
Hi WSilveira
Not sure if this is a bug, but I'm running into another issue.
I've created a couple of functions in https://github.com/ronaldbosma/track-availability-in-app-insights/blob/main/src/logicApp/Functions/AvailabilityTestFunctions.cs that I use to track availability in Application Insights. In the code, I create a new Activity in the TrackAvailability method, which under the hood relies on Activity.Current.
Before my upgrade, my workflow logging and the availability telemetry were correlated in Application Insights. Here's a screenshot with the availability telemetry at the bottom: https://ronaldbosma.github.io/images/track-availability-in-app-insights-series/track-availability-in-app-insights-using-logic-app-workflow/logic-app-workflow-end-to-end-transaction-details.png
After upgrading to .NET 10, the availability telemetry is no longer correlated with the workflow logging. (Traces when using _logger.LogInformation are still correlated.)
I've added the following to the `TrackAvailability` method:
Activity currentActivity = Activity.Current;
_logger.LogInformation(
"Current Activity Static: Id={Id}, IdFormat={IdFormat}, " +
"TraceId={TraceId}, SpanId={SpanId}, ParentSpanId={ParentSpanId}",
currentActivity?.Id,
currentActivity?.IdFormat,
currentActivity?.TraceId,
currentActivity?.SpanId,
currentActivity?.ParentSpanId);
This is logged in .NET 8:
Severity level: Information, Message: Current Activity Static: Id=00-83fc6659fbfc9f475575d0f73c7b70d7-3e208e36e4d0b070-00, IdFormat=W3C, TraceId=83fc6659fbfc9f475575d0f73c7b70d7, SpanId=3e208e36e4d0b070, ParentSpanId=0000000000000000
This is logged in .NET 10:
Severity level: Information, Message: Current Activity Static: Id=(null), IdFormat=(null), TraceId=(null), SpanId=(null), ParentSpanId=(null)
Activity.Current is null after the upgrade to .NET 10. Is this a bug/regression or do I have to correlate my availability telemetry another way in my Logic App?