Azure Automation and logs in OMS

In this installment, we will look closer at some aspects of automation especially in the era of Azure Automation. I am a monitor person of hearth, and firmly believe that every piece of software running out there should adhere to the principal “more information the better”. By that, I mean that every piece of running code should as a minimum log what it does logically. By this I mean if you are using New-ADUser cmdlet to create a new user, as a minimum one should log what parameters are used in creating this user. I am also a firm believer of using multiple sources, and one of those sources should be a monitoring solution. For creating a new user, I would typically do this when it comes to logging. For me this is good practice, but your mileage may vary.

So the logic aspect of it, creating the user and the values for the attributes, are logged to an outside source. In this case, both the Automation database and the local computers event log. The eventlog is used so a monitoring system like SCOM (System Center Operations Manager) can pick up the information and make it available through views for administrators to check. Monitoring systems are usually very powerful when it comes to visualization of what is happening in the different logical layers of the infrastructure, so it is good practice to feed these with additional data to give the possibility of drawing a more complete picture of what is happening. Not just for problems, but also to see that there is a matchup of what the business logic dictates, and what the actual code logic does. read more