How to obtain the input that went to a logic app for all failure scenarios

Aswin Aravind C 20 Reputation points
2024-11-07T06:50:47.5266667+00:00

I have noticed that over a period of 2 months, almost 18K API calls have failed to a particular logic app workflow. I would like to get the initial input that went to all these 18K calls. I tried the below query in log analytics workspace.

AppRequests
| where Name == 'name of my workflow'

I have set the timeframe appropriately. This gives me the list of all app request calls that happened but doesn't give me the input JSON that went in to those. Is there a way to get them?

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,251 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Khadeer Ali 1,215 Reputation points Microsoft Vendor
    2024-11-07T07:45:44.1266667+00:00

    Hi @Aswin Aravind C

    Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.

    To retrieve the input that went to your Logic App workflow for failed API calls, you need to extend your Log Analytics query to capture the detailed execution history, including the inputs, for those requests. Here’s a more detailed approach:

    AppRequests
    
    | where Name == 'your-workflow-name'
    
    | where Status == 'Failed'  // Filter for failed requests
    
    | join kind=inner (
    AppTraces
    
    | where Name == 'your-workflow-name'
    
    | where Message contains 'Trigger'  // Message contains the trigger information, adjust as per your workflow's structure
    ) on $left.ResourceId == $right.ResourceId
    
    | project TimeGenerated, Message, Input = parse_json(Message)["inputs"], Status
    
    
    

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


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.