Amit Anand
Amit Anand

Reputation: 1109

Logic App Standard tracked properties not showing up in Application Insights / Azure Log Analytics logs

I am trying to log Tracked Properties from Azure Logic App Standard to Azure Application Insights, however even after setting up all the Configurations the tracked properties are not showing up in the Application Insights Logs (traces). Below are some details about the Logic App (Standard) and the settings that I have enabled for the same.

  1. Logic App Workflow Type: Stateful
  2. Trigger: When messages are available in Queue (Peek Lock).
  3. Trigger Type: In App (built-in) because my Logic Apps are deployed in an ASE V3.
  4. Tracked Properties: I am trying to get the messageId as the Split-On Tracking Id by using the following expression @triggerOutputs()?['body']?['messageId'].
{
   "splitOn":"@triggerOutputs()?['body']",
   "splitOnConfiguration":{
      "correlation":{
         "clientTrackingId":"@triggerOutputs()?['body']?['messageId']"
      }
   }
}

When I save the workflow, it gets saved successfully and even runs as expected but the Tracked Properties never gets logged in Application Insights / Log Analytics Workspace. Please be informed that the other logs for this workflow are getting logged and I am able to fetch them successfully by Querying traces in App Insights.

Similarly I tried adding a tracked property to a simple InitializeVariable action but it doesn't work there too.

{
   "type":"InitializeVariable",
   "inputs":{
      "variables":[
         {
            "name":"Id",
            "type":"string",
            "value":"@{variables('QueueMessageBody')?['Details']?['Id']}"
         }
      ]
   },
   "runAfter":{
      "Initialize_Message_Body":[
         "Succeeded"
      ]
   },
   "trackedProperties":{
      "RequestId":"@{action()['inputs']?['variables'][0].value}"
   }
}

Even when I change the value of the Tracked Property to some hard coded value, it still doesn't show up in the logs.

Below are the settings that I have enabled for my Logic App.

  1. My Logic App is connected to an Application Insights Resource.
  2. I have a Log Analytics Workspace Created in the same resource group.
  3. Under Logic App Diagnostic settings, I have enabled it for Log Analytics Workspace and have configured the collection of the following data.

I tried to follow some of the work arounds available online (and listed below) but nothing seems to work.

Logic app tracked properties are not getting logged in log analytic workspace

https://learn.microsoft.com/en-us/answers/questions/1625056/logic-app-standard-tracked-properties-not-showing

Any help is highly appreciated.

Upvotes: 0

Views: 756

Answers (1)

Ikhtesam Afrin
Ikhtesam Afrin

Reputation: 6484

"splitOnConfiguration": {
    "correlation": {
        "clientTrackingId": "@triggerOutputs()?['body']?['messageId']"
    } } ```

This configuration does work, you can check both the condition before splitOnConfiguration and after adding it.

  • When I had below configuration in logic app.

enter image description here

  • I am getting clientTrackingId as a random number in output.

enter image description here

  • When I added @triggerOutputs()?['body']?['messageId'] on Split-On Tracking Id, I got the below output.

enter image description here

  • You can also check this in log analytics workspace and application insight.

enter image description here

enter image description here

References-

SplitOn client tracking Id in logic apps - Atomic Scope.

Upvotes: 0

Related Questions