I see a lot of potential in Azure Log Analytics. That should go without saying considering the amount of time I have spent learning and documenting it over the past few weeks. One of the most exciting features that adds tremendous flexibility is the ability to log directly to Log Analytics with the Web API. Logging to the Web API enables anything to be written to Log Analytics without the use of the Microsoft Monitoring agent.
In this video I go over writing data directly to Log Analytics with the HTTP Data Collector API using PowerShell. The goal was to create a universal way to write any data to log analytics. I did this by creating a function that takes the date, the log Type and a hashtable of key and data pairs and writes it to a Log Analytics workspace.
The function can be added to a script and used to send data directly to Log Analytics. I use it in a Module added to Azure Automation. From there I can write data to Log Analytics from any Azure Automation Runbooks. Once in Log Analytics, I can trigger alerts or tie into Logic Apps to kick off other Run Books, alerts or webhooks to other systems.
Additional data can be found here:
The function can be found here: