Monitoring Dashboard for Azure Automation Accounts

Mohamed jihad bayali 1,136 Reputation points
2023-01-02T15:53:55.637+00:00

Hello,

I'm looking for a graph to monitor the activity of an Azure automation account (Completed runbook,failed,Suspended..Etc), the idea is to pin this graph to my Azure Dashboard.

On the overview of the automation account, i can see the following job statistics which is interesting :

275415-image.png

But i cannot pin it to my Dashboard.

Any help?

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,366 questions
0 comments No comments
{count} votes

Accepted answer
  1. Alistair Ross 7,466 Reputation points Microsoft Employee
    2023-01-03T11:28:32.787+00:00

    Hello @Mohamed jihad bayali

    Specifically for a pie chart, there is no direct way of pinning to a dashboard. You can pin a metrics chart and split the total by status and pin that to a dashboard, but whether you render the results as a grid, or another available chart, you will not get pie chart.

    275609-image.png

    As @JimmySalian-2011 has suggest, you can export the logs to Azure Monitor, specifically the JobLogs diagnostic setting is what you want. I've provided a log query that will render the results for you here. You can then pin this to a dashboard.

    let IgnoreJobs = dynamic('["ImportAutomationModule2", "Compile-ConfigurationV3"]');  
    AzureDiagnostics   
    | where Category == "JobLogs"  
    | where RunbookName_s !in (IgnoreJobs)  
    | where ResultType in ("Completed", "Failed", "Queued", "Running", "Stopped", "Suspended")  
    | summarize arg_max(TimeGenerated, ResultType) by JobId_g  
    | summarize Count = count() by ResultType  
    | render piechart   
    

    Note: In this query I have an array called ignore jobs. I used this to filter out the jobs that are displayed in the logs, but not part of the Jobs list in the automation account.

    Alternatively you can build the pie chart in an Azure Workbook and use that as your dashboarding tool, or pin the chart to the Azure Dashboard. Personally I prefer workbooks as I can utilise drill down capabilities and have more control over the UI, but it is your choice. Here is my dashboard with the workbook on the left and direct log query on the right.

    275619-image.png

    The workbook can be found here: https://github.com/TheAlistairRoss/AzureMonitor/blob/main/Workbooks/AutomationAccount/JobStatusPieChart.json

    I hope this helps provide you with the information you need. If it does, please make sure to mark the question as answered so it helps other people in future.

    Kind regards

    Alistair

    0 comments No comments

3 additional answers

Sort by: Most helpful
  1. JimmySalian-2011 42,491 Reputation points
    2023-01-03T07:53:41.173+00:00

    Hi,

    I am not sure if this is possible but you can explore the Automation Dashboard page and check this detailed thread on this. Also you can try to export to Azure Monitor Logs and from there can configure the Dashboard.

    There is another option to programmitcally configure the Dashboard customize - azure-portal-dashboards-create-programmatically

    Hope this helps.
    JS

    ==
    Please Accept the answer if the information helped you. This will help us and others in the community as well.

    0 comments No comments

  2. Mohamed jihad bayali 1,136 Reputation points
    2023-01-03T14:08:43.577+00:00

    Hello AlistairRoss-msft,

    Thank you for your answer, it helped very well.

    I was able to redirect the diag logs to my log anlaytics, and then used your query to get the dashboard, it works as expected.

    275727-image.png

    I'm not very familiar with Workbooks but i want to test it, if i understand correctly, i would need to modify the json file that you sent me (Subscription name, Automation account name....)

    And then create a new Azure Workbook, and then past the json in it ?
    275719-image.png

    For the creation of the workbook, i go to Azure Workbooks,quick start, add query, on data Source i choose Json, and then i run the query?

    Thank you again


  3. Mohamed jihad bayali 1,136 Reputation points
    2023-01-03T14:38:26.183+00:00

    You're the boss !!!!
    Thank you a lot again, it works perfectly

    0 comments No comments

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.