Azure function to write logs to Azure log Analytics

Amar-Azure-Practice 661 Reputation points
2021-02-07T05:23:48.78+00:00

Hi

I have multiple Azure functions developed in C#, from Azure Functions we would like write log information
to Azure log Analytics work space using the C# .

we would like to use the API mentioned in the below

[data-collector-api][1]

please let me know this approach is correct approach or not

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,371 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JayaC-MSFT 5,526 Reputation points
    2021-02-08T10:21:59.55+00:00

    Hello @Amar-Azure-Practice , You can leverage the management API endpoints to use the data collector one : https://learn.microsoft.com/en-us/rest/api/loganalytics/create-request

    You can use Httpclient to make an API call to the endpoints mentioned in the document. You may need to pass an authorization token for validation , for that please refer to this