Durable function logging and application insight

ZZ 120 Reputation points
2025-06-19T10:24:26.9966667+00:00

When invoking an azure durable function, the response gives an 'id', which is the same 'instanceId' in the 'queryStatusUrl'.

I want to know if there is a way to filter all logs produced by this instance when looking at the logs for this azure function using application insights. I mean, obviously all logs for this function app can be found in application insights but how do you know which belongs to which 'invocation'? Can you link them by using this 'id/instanceId'?

If not directly, can this be achieved through configuring my app's logging, or even 'acquiring' this id and then use it in my own logging code?

Thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
{count} votes

Accepted answer
  1. Praveen Kumar Gudipudi 1,805 Reputation points Microsoft External Staff Moderator
    2025-06-24T10:28:57.14+00:00

    Hello ZZ,

    Glad to hear that your issue has been resolved.

    After using below query:

    let targetInstanceId = "instance-id-of-the-durable-function-call";

    let hostId =

    requests
    
    | where customDimensions.DurableFunctionsInstanceId == targetInstanceId
    
    | project HostInstanceId = tostring(customDimensions.HostInstanceId)
    
    | take 1;
    

    traces

    | where tostring(customDimensions.HostInstanceId) in (hostId)

    | project timestamp, message, customDimensions

    Note: you must firstly find out what ID the actual started instance gets, then use that to find the logs.

    If this answer was helpful, please click "Accept the answer" and mark Yes, as this can help other community members.

    User's image

    If you have any other questions or are still experiencing issues, feel free to ask in the "comments" section, and I'd be happy to help.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.