Search code examples
azureballerinaballerina-swan-lake

How can I execute an Azure log analytics query from a ballerina code


I have a requirement to execute an Azure log analytics query from a ballerina code. How can I execute this? Is there a guide on how to do it?


Solution

  • We don't have an OOTB client for Azure Logs API. But by Using the Ballerina HTTP client, you will be able to call the API directly. https://learn.microsoft.com/en-us/azure/azure-monitor/logs/api/overview#try-the-log-analytics-api

    Examples of HTTP clients can be found here. https://ballerina.io/learn/by-example/#http-client