Show results of SQL query on Azure Dashboard
I like to show the result of SQL Query on a Azure Dashboard. “Should be checken food” I thought. I checked a ton of options and finally got solution working.
One way I found was by writing a custom HTTP endpoint which returns Markdown text. I then added the Markdown widget and entered the endpoints URL as the external Markdown source.
This is how it looks like when my endpoint returned the string “58 Events”:
If you already have a AppService app or something similar you maybe like to integrate such “monitoring endpoints” in your solution. I didn’t like to to do it.
So how did implement the custom HTTP endpoint? Because I had issues with Azure Functions and query a SQL database in the past I’ve chosen Azure LogicApp to do it.
A LogicApp can be triggered on HTTP requests, can do SQL queries and can respond to HTTP requests. The down-side: LogicApps cost per execution. Not much but they cost. So its more proof-of-concept type of a solution. Read about my logic-app here…
- Use Azure Functions instead of the LogicApp.
- Use a web app instead of the LogicApp.
- Log it as log-events and use Azure Monitor Workbook to query it and build a nice report (workbooks can be pinned to Azure Dashboard).
Hey, thanks for the headstart, you pointed me in the right direction to show sql results in the dashboard.
I figured out how to get azure function results in the tile!
It is a CORS error. If you go to the azure functions app in the portal, go to the CORS menu, add a * to Allowed Origins, and it works in the dashboard!