Search code examples
azureazure-automationazure-diagnosticsazure-log-analytics

Azure Automation diagnostics not saved


What I'm trying to create is a solution where we have an Azure Automation account running some scripts and that the error messages generated from the jobs are saved in an Azure resource where we can setup alerts and analyze the errors.

The Azure Automation account is setup and I can create jobs properly. I added a diagnostics settings that sends to log analytics workspace all the JobLogs, JobStreams and AllMetrics. But when I open the Log Analytics workspace the Logs view there shows nothing and the Related Resources\Automation Account simply says that nothing is connected.

I have been reading through A LOT of documentation but I have not been able to find any clear guide at all of how to connect everything together in 2019 especially when they keep changing everything on Azure all the time.


Solution

  • This should be the document that you are looking for to forward joblogs, jobstreams, dscnodestatus, allmetrics from Azure Automation to Azure monitor logs.

    After you have enabled it, you may also double check it by using Get-AzDiagnosticSetting cmdlet as explained in the same above mentioned document. Or else you may go to Azure portal -> Your Automation Account -> Diagnostics settings tile -> make sure joblogs, jobstreams, dscnodestatus, allmetrics are ticked.

    I have followed the same instructions and could see the joblogs, jobstreams in the logs as shown in below screenshot.

    enter image description here

    Hope this helps!! Cheers!!