Googleアナリティクス

2018年6月26日火曜日

Acquire execution history of LogicApps with LogicApps

Original post is here.

I attempted to retrieve the execution history of Logic Apps and tried to see if I could see the date and time that I processed recently.

In order to acquire the execution history of Logic Apps, it is necessary to use management REST API. By using the API of Workflow Get, you can acquire the execution history of the specified Logic Apps. But at this time there is a runName parameter that is necessary, but there is no easy way to get this information. Therefore, we will do history acquisition by using List API rather than Get.

The LogicFlow created this time is as follows.

image

First, we will acquire the bearer token necessary for using the API. LogicFlow sample uploaded to Github. See also past entries.

Access the management API using Bearer Token.

image

The access URL to the List API is in this form.

https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Logic/workflows/{workflowName}/runs?api-version=2016-06-01

Include the subscription ID, resource group name, LogicFlow name you want to retrieve and call with GET.

image

If you can call the API successfully, results like the above will be returned. It is the runName you wrote first, but the name in this value corresponds to that. This value is set for each execution, and you do not know the value unless you acquire this history ....

image

The history to be returned includes those that are being executed. You can determine that it is running because status is Running. Also, the start time, the end time, the time when the termination was reflected were acquired.

image

In some cases, you can also get the result of execution failure. In this case, an error code and a message are included as error.

By using this API, you can see when LogicFlow was executed and the result was what it was. Since the URL for obtaining the result is also returned as a value, all the information that can be checked on the portal can be confirmed from this as a starting point.

0 件のコメント:

コメントを投稿