Azure webjob output logs streaming to log analytics workspace

Naveen Kumar Jain S 41 Reputation points
2021-11-22T07:13:51.613+00:00

Hi,

I have setup a webjob of type triggered in azure app service which is running nodejs code at every minute( So there is no webjob SDK used). There are few console.log() lines in the code which are getting logged to output_log.txt. But I want to stream these logs to log analytics workspace(application insights).

When the app insights is enabled for that app service in which webjob is running the webjob console logs are not included in app insights.

How can I add these console logs of webjob to log analytics workpace.?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,214 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ryan Hill 28,091 Reputation points Microsoft Employee
    2021-11-24T14:04:52.67+00:00

    Hi @Naveen Kumar Jain S ,

    You can create an Application Insights resource that's workspace-based. The logging you're doing to you output_log.txt you can send to AppInsights using code-based monitoring. This option is real-time; however, you also have the option of ingesting output_log.txt using a logic app. You can store the log file in a storage account and the logic app will grab this file and upload it into the log analytics workspace. There's also HTTP Collector API method currently in preview that you can write code in your webjob to push that data itself.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.