Skip to content

Commit 9c67426

Browse files
Merge pull request #116211 from MGoedtel/UpdateAAAcountTemplate522
updated article to clarify log forwarding
2 parents 150eb8e + 510cb19 commit 9c67426

File tree

3 files changed

+17
-13
lines changed

3 files changed

+17
-13
lines changed

articles/automation/automation-create-account-template.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.subservice: update-management
66
ms.topic: conceptual
77
author: mgoedtel
88
ms.author: magoedte
9-
ms.date: 04/24/2020
9+
ms.date: 05/22/2020
1010
---
1111
# Create an Automation account using an Azure Resource Manager template
1212

@@ -21,6 +21,8 @@ The template doesn't automate the enabling of Azure or non-Azure virtual machine
2121
>[!NOTE]
2222
>Creation of the Automation Run As account is not supported when you're using an Azure Resource Manager template. To create a Run As account manually from the portal or with PowerShell, see [Manage Run As accounts](manage-runas-account.md).
2323
24+
After you complete these steps, you need to [configure diagnostic settings](automation-manage-send-joblogs-log-analytics.md) for your Automation account to send runbook job status and job streams to the linked Log Analytics workspace.
25+
2426
## API versions
2527

2628
The following table lists the API version for the resources used in this example.
@@ -304,6 +306,4 @@ If you're new to Azure Automation and Azure Monitor, it's important that you und
304306

305307
## Next steps
306308

307-
* To get started with PowerShell runbooks, see [Create a PowerShell runbook](automation-first-runbook-textual-powershell.md).
308-
* To get started with PowerShell workflow runbooks, see [Create a PowerShell Workflow runbook](automation-first-runbook-textual.md).
309-
* To get started with Python 2 runbooks, see [Create a Python runbook](automation-first-runbook-textual-python2.md).
309+
To forward runbook job status and job streams to your linked Log Analytics workspace, review [Forward Azure Automation job data to Azure Monitor logs](automation-manage-send-joblogs-log-analytics.md). This configures the diagnostic settings of the Automation account using Azure PowerShell commands to complete the integration for sending logs to the workspace for analysis.

articles/automation/automation-manage-send-joblogs-log-analytics.md

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Forward Azure Automation job data to Azure Monitor logs
33
description: This article tells how to send job status and runbook job streams to Azure Monitor logs.
44
services: automation
55
ms.subservice: process-automation
6-
ms.date: 02/05/2019
6+
ms.date: 05/22/2020
77
ms.topic: conceptual
88
---
99

@@ -41,11 +41,11 @@ To find the resource ID for your Log Analytics workspace, run the following Powe
4141
Get-AzResource -ResourceType "Microsoft.OperationalInsights/workspaces"
4242
```
4343

44-
If you have more than one Automation account or workspace in the output of the preceding commands, find the name that you need to configure and copy the value for the resource ID.
44+
If you have more than one Automation account or workspace in the output of the preceding commands, you can find the name and other related properties that are part of the full resource ID of your Automation account by performing the following:
4545

46-
1. In the Azure portal, select your Automation account from the **Automation account** blade and select **All settings**.
47-
2. From the **All settings** blade, under **Account Settings**, select **Properties**.
48-
3. In the **Properties** blade, note the properties shown below.
46+
1. In the Azure portal, select your Automation account from the **Automation Accounts** page.
47+
2. On the page of the selected Automation account, under **Account Settings**, select **Properties**.
48+
3. In the **Properties** page, note the details shown below.
4949

5050
![Automation account properties](media/automation-manage-send-joblogs-log-analytics/automation-account-properties.png).
5151

@@ -100,11 +100,11 @@ Azure Automation diagnostics create two types of records in Azure Monitor logs,
100100
## Set up integration with Azure Monitor logs
101101

102102
1. On your computer, start Windows PowerShell from the **Start** screen.
103-
2. Run the following PowerShell commands, and edit the values for `[your resource ID]` and `[resource ID of the log analytics workspace]` with the values from the preceding section.
103+
2. Run the following PowerShell commands, and edit the values for `$automationAccountId` and `$workspaceId` with the values from the preceding section.
104104

105105
```powershell-interactive
106-
$workspaceId = "[resource ID of the log analytics workspace]"
107-
$automationAccountId = "[resource ID of your Automation account]"
106+
$workspaceId = "resource ID of the log analytics workspace"
107+
$automationAccountId = "resource ID of your Automation account"
108108
109109
Set-AzDiagnosticSetting -ResourceId $automationAccountId -WorkspaceId $workspaceId -Enabled 1
110110
```
@@ -136,22 +136,26 @@ To see the logs, run the following query:
136136

137137
### Send an email when a runbook job fails or suspends
138138

139-
One of the top customer asks is for the ability to send an email or a text when something goes wrong with a runbook job.
139+
The following steps show how to set up alerts in Azure Monitor to notify you when something goes wrong with a runbook job.
140140

141141
To create an alert rule, start by creating a log search for the runbook job records that should invoke the alert. Click the **Alert** button to create and configure the alert rule.
142142

143143
1. From the Log Analytics workspace Overview page, click **View logs**.
144+
144145
2. Create a log search query for your alert by typing the following search into the query field: `AzureDiagnostics | where ResourceProvider == "MICROSOFT.AUTOMATION" and Category == "JobLogs" and (ResultType == "Failed" or ResultType == "Suspended")`<br><br>You can also group by the runbook name by using: `AzureDiagnostics | where ResourceProvider == "MICROSOFT.AUTOMATION" and Category == "JobLogs" and (ResultType == "Failed" or ResultType == "Suspended") | summarize AggregatedValue = count() by RunbookName_s`
145146

146147
If you set up logs from more than one Automation account or subscription to your workspace, you can group your alerts by subscription and Automation account. Automation account name can be found in the `Resource` field in the search of `JobLogs`.
148+
147149
3. To open the **Create rule** screen, click **New Alert Rule** at the top of the page. For more information on the options to configure the alert, see [Log alerts in Azure](../azure-monitor/platform/alerts-unified-log.md).
148150

149151
### Find all jobs that have completed with errors
150152

151153
In addition to alerting on failures, you can find when a runbook job has a non-terminating error. In these cases, PowerShell produces an error stream, but the non-terminating errors don't cause your job to suspend or fail.
152154

153155
1. In your Log Analytics workspace, click **Logs**.
156+
154157
2. In the query field, type `AzureDiagnostics | where ResourceProvider == "MICROSOFT.AUTOMATION" and Category == "JobStreams" and StreamType_s == "Error" | summarize AggregatedValue = count() by JobId_g`.
158+
155159
3. Click the **Search** button.
156160

157161
### View job streams for a job
16 Bytes
Loading

0 commit comments

Comments
 (0)