How to export Logic App Run History Data?

Mohamed Sahbi 51 Reputation points
2022-04-01T16:30:44.753+00:00

Hello,
I would like to know how can I export Input or Output in a given connector that we can see in the Run History details.

I have a logic App that uses IBM MQ Connector, it dequeues messages and then they are processed by an Azure Function.
Unfortunately, there was not a bullet proof failover scenario, so some messages were not processed when the flow failed.

To recover these messages, I have one option and that is: to export them from the Run History. It is possible to be done from the UI, but it cannot help when the Logic App runs every 10 seconds.

Is there an API or a way to export not just Runs metadata, but also the data (output/input) of the connectors?

Thank you.

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

Accepted answer
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2022-04-05T06:01:00.673+00:00

    @Mohamed Sahbi Thanks for the confirmation. You can leverage below REST API's to get the input/output on any action in your workflow for your runID's

    To list the workflow run you can leverage the List REST API. You can filter based on Status, StartTime, and ClientTrackingId. The REST document covers this in detail. For reference, I have only filtered for the Failed run for my workflow.

    URL : /subscriptions/{subscriptionID}/resourceGroups/{resourcegroupname}/providers/Microsoft.Logic/workflows/{workflowname}/runs?api-version=2016-06-01&%24filter=Status%20eq%20'Failed'&%24expand=properties
    Query Parameter :
    api-version=2016-06-01
    $filter=Status eq 'Failed'
    expand=properties

    Once you have the list of runID's for which you want to get action/trigger etc in detail then you can leverage the Get workflow run REST API.
    {runID} is the clientTrackingId property return form the List REST API

    URL : /subscriptions/{subscriptionID}/resourceGroups/{resourcegroupname}/providers/Microsoft.Logic/workflows/{workflowname}/runs/{runID}?api-version=2016-06-01&%24expand=properties%2Factions%2Cproperties%2FconnectionParameters%2Cproperties%2Fswagger%2Cworkflow%2Fproperties
    Query Parameter :
    api-version=2016-06-01
    $expand=properties/actions,properties/connectionParameters,properties/swagger,workflow/properties

    The Get workflow run REST API along with $expand query parameter will list all the actions/trigger. You will find the uri property for your action/trigger inside the inputsLink/outputsLink property as below.

    189996-image.png

    Now you can make an HTTP request call on the uri parameter to get the actual JSON value input/output for action/trigger. You need to review the JSON return from the uri response to get the actual content.

    Note: The above is only for reference and you need to modify it as per your requirement.

    Feel free to get back to me if you need any assistance.

    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


1 additional answer

Sort by: Most helpful
  1. Andrew Blumhardt 10,051 Reputation points Microsoft Employee
    2022-04-01T16:59:40.293+00:00

    Maybe someone else has a better answer but you can add to your app additional logging capabilities. For example, writing to blob storage or Log Analytics during processing for more detailed tracking.


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.