You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/automation/automation-create-account-template.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ ms.subservice: update-management
6
6
ms.topic: conceptual
7
7
author: mgoedtel
8
8
ms.author: magoedte
9
-
ms.date: 04/24/2020
9
+
ms.date: 05/22/2020
10
10
---
11
11
# Create an Automation account using an Azure Resource Manager template
12
12
@@ -21,6 +21,8 @@ The template doesn't automate the enabling of Azure or non-Azure virtual machine
21
21
>[!NOTE]
22
22
>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).
23
23
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
+
24
26
## API versions
25
27
26
28
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
304
306
305
307
## Next steps
306
308
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.
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:
45
45
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.
@@ -100,11 +100,11 @@ Azure Automation diagnostics create two types of records in Azure Monitor logs,
100
100
## Set up integration with Azure Monitor logs
101
101
102
102
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.
104
104
105
105
```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"
@@ -136,22 +136,26 @@ To see the logs, run the following query:
136
136
137
137
### Send an email when a runbook job fails or suspends
138
138
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.
140
140
141
141
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.
142
142
143
143
1. From the Log Analytics workspace Overview page, click **View logs**.
144
+
144
145
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`
145
146
146
147
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
+
147
149
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).
148
150
149
151
### Find all jobs that have completed with errors
150
152
151
153
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.
152
154
153
155
1. In your Log Analytics workspace, click **Logs**.
156
+
154
157
2. In the query field, type `AzureDiagnostics | where ResourceProvider == "MICROSOFT.AUTOMATION" and Category == "JobStreams" and StreamType_s == "Error" | summarize AggregatedValue = count() by JobId_g`.
0 commit comments