Search code examples
azureazure-functionsazure-logic-apps

Pass custom tracking ID from Logic app to Function app


I want to be able to pass the custom tracking ID to the function app. I have a logic app which calls the function app and I need to pick up the custom tracking ID so I can make use of Application Insights for a complete track of the flow from start to end.

Do any of you have an idea how to achieve this?

enter image description here


Solution

  • You cannot get tracking Id directly from trigger action to use it in next actions in workflow. Aletrnatively, you can send tracking id to http trigger and then set the tracking id in headers and then also send it in body:

    enter image description here

    Body:

    {"id":"8'}
    

    enter image description here

    Now, you can use the value of id in next step with triggerbody(), You can send it now to azure functions as its headers and inside the function app log its value, to get to know the tracking id. So, this is one of way to get and there is no direct way to get tracking inside the logic app in next actions. It is logged and stored In logs of Logic apps. Tracking id is only used for logging for Logic apps.

    EDIT:

    Alternatively,thanks @10p, you can use below lines to get tracking id and then you can send it to function as header as mentioned above:

    @{trigger()?['clientTrackingId']}
    
    @{trigger()?['trackingId']}