How can I get my Durable Function activities to inherit the tracing id of the HttpTrigger that started it?

58 Views Asked by At

I have an Azure functions C# project. In the startup I have the following

        services.AddApplicationInsightsTelemetryWorkerService();
        services.ConfigureFunctionsApplicationInsights();

I then have an HTML trigger function...

    [Function("delete-message")]
    public async Task<HttpResponseData> Run(
        [HttpTrigger(AuthorizationLevel.Anonymous, "post")]
        HttpRequestData req,
        [DurableClient] DurableTaskClient durableClient)
    {
        _ = await durableClient
            .ScheduleNewOrchestrationInstanceAsync(
                orchestratorName: DeleteMessageOrchestrator.OrchestratorId,
                payload);
        retun ........;
    }
}

These are appearing as completely unrelated in Application Insights. How can I ensure the activity context continues to be used so I can see my orchestrated Durable Function executions nested inside the HttpTrigger that scheduled them?

0

There are 0 best solutions below