In a previous post, I showed how to implement Business Activity Monitoring for Logic Apps. However, sometimes developers, ops, or business users want to query execution logs to get information about the processing of business messages. Whether for troubleshooting or auditing, there are some questions these personas might have, like:
As we saw in that post, we can send diagnostic log information and custom tracked properties to Azure Log Analytics. We also saw how easy is to query those logs to get information about Logic Apps execution and messages processed. Now the question is, how can we publish those custom queries, so different users can make use of them? In this post, I’ll show one easy way to do that.
The first thing to do is to track the relevant custom properties we need for our queries as tracked properties in our Logic App workflow. Then you need to configure the Logic App workflow to send diagnostics information to Azure Log Analytics. You can follow the instructions on my previous post to perform those steps.
Once the information is being logged on Log Analytics, we need to create the queries to give the users the information they need. For that, first we need to open the Azure Log Analytics Portal. To open the portal we need to
And now you are ready to create your own queries.
Based on the tracked properties of the Logic App workflow shown in my previous post, I wrote this query to get all orders processed in the time range selected. This query returns, order number, total, date, channel, customer Id, the name of the Logic App workflow which processed this message, and the workflow run id. These last 2 columns would be quite handy for troubleshooting.
Once we have the query ready, we can save it and export it, so later we can publish it. To do that, we follow the steps below
After we have gotten the link to the query, we can publish it in the same Dashboard we created for our BAM charts described in my previous post. We need to:
Now the users will have all the charts and custom queries they need in one single place!
Logic Apps provide a very detailed view of the execution of the workflows. However, I’ve been asked so many times to make easier to users to get the run details of a particular business message. Here is a tip on how to do it.
Now users can query the orders submitted by a user, get the workflow run id, and get the workflow run details in very few clicks. Quite handy! :)
In this post, we’ve seen how to create and publish custom queries of Logic Apps execution logs. We’ve also seen how to make easier to users to get the workflow run details of the processing of a particular business message. Now you should be ready to start creating and publishing your own custom queries and creating amazing monitoring and tracking dashboards for your Logic Apps solutions.
I hope you’ve got some useful tips from this post and you’ve enjoyed it. Feel free to leave your questions or comments below,
Cross-posted on Paco’s Blog.
Follow Paco on @pacodelacruz.