Skip to content

Commit 741bb2e

Browse files
authored
Merge pull request #172611 from dagiro/1875987
1875987 - Automation - nxautomation and omsagent account explanation
2 parents 641195a + ac72f79 commit 741bb2e

File tree

3 files changed

+21
-23
lines changed

3 files changed

+21
-23
lines changed

articles/automation/automation-hrw-run-runbooks.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ title: Run Azure Automation runbooks on a Hybrid Runbook Worker
33
description: This article describes how to run runbooks on machines in your local datacenter or other cloud provider with the Hybrid Runbook Worker.
44
services: automation
55
ms.subservice: process-automation
6-
ms.date: 09/22/2021
6+
ms.date: 09/30/2021
77
ms.topic: conceptual
88
ms.custom: devx-track-azurepowershell
99
---
1010

11-
# Run runbooks on a Hybrid Runbook Worker
11+
# Run Automation runbooks on a Hybrid Runbook Worker
1212

1313
Runbooks that run on a [Hybrid Runbook Worker](automation-hybrid-runbook-worker.md) typically manage resources on the local computer or against resources in the local environment where the worker is deployed. Runbooks in Azure Automation typically manage resources in the Azure cloud. Even though they are used differently, runbooks that run in Azure Automation and runbooks that run on a Hybrid Runbook Worker are identical in structure.
1414

@@ -22,12 +22,24 @@ Enabling the Azure Firewall on [Azure Storage](../storage/common/storage-network
2222

2323
Azure Automation handles jobs on Hybrid Runbook Workers differently from jobs run in Azure sandboxes. If you have a long-running runbook, make sure that it's resilient to possible restart. For details of the job behavior, see [Hybrid Runbook Worker jobs](automation-hybrid-runbook-worker.md#hybrid-runbook-worker-jobs).
2424

25-
Jobs for Hybrid Runbook Workers run under the local **System** account on Windows, or the **nxautomation** account on Linux. For Linux, verify the **nxautomation** account has access to the location where the runbook modules are stored. To ensure **nxautomation** account access:
25+
## Service accounts
26+
27+
### Windows
28+
29+
Jobs for Hybrid Runbook Workers run under the local **System** account.
30+
31+
### Linux
32+
33+
Service accounts **nxautomation** and **omsagent** are created. The creation and permission assignment script can be viewed at [https://github.com/microsoft/OMS-Agent-for-Linux/blob/master/installer/datafiles/linux.data](https://github.com/microsoft/OMS-Agent-for-Linux/blob/master/installer/datafiles/linux.data). The accounts, with the corresponding sudo permissions, must be present during [installation of a Linux Hybrid Runbook worker](automation-linux-hrw-install.md). If you try to install the worker, and the account is not present or doesn't have the appropriate permissions, the installation fails. Do not change the permissions of the `sudoers.d` folder or its ownership. Sudo permission is required for the accounts and the permissions shouldn't be removed. Restricting this to certain folders or commands may result in a breaking change. The **nxautomation** user enabled as part of Update Management executes only signed runbooks.
34+
35+
To ensure the service accounts have access to the stored runbook modules:
2636

27-
- When you use the [Install-Module](/powershell/module/powershellget/install-module) cmdlet, be sure to specify `AllUsers` for the `Scope` parameter.
2837
- When you use `pip install`, `apt install` or other method for installing packages on Linux, ensure the package is installed for all users. For example `sudo -H pip install <package_name>`.
38+
- If using [PowerShell on Linux](/powershell/scripting/whats-new/what-s-new-in-powershell-70), when you use the [Install-Module](/powershell/module/powershellget/install-module) cmdlet, be sure to specify `AllUsers` for the `Scope` parameter.
39+
40+
The Automation worker log is located at `/var/opt/microsoft/omsagent/run/automationworker/worker.log`.
2941

30-
For more information on PowerShell on Linux, see [Known Issues for PowerShell on Non-Windows Platforms](/powershell/scripting/whats-new/what-s-new-in-powershell-70).
42+
The service accounts are removed when the machine is removed as a Hybrid Runbook Worker.
3143

3244
## Configure runbook permissions
3345

articles/automation/automation-linux-hrw-install.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ If you don't have an Azure Monitor Log Analytics workspace, review the [Azure Mo
2828

2929
### Log Analytics agent
3030

31-
The Hybrid Runbook Worker role requires the [Log Analytics agent](../azure-monitor/agents/log-analytics-agent.md) for the supported Linux operating system. For servers or machines hosted outside of Azure, you can install the Log Analytics agent using [Azure Arc-enabled servers](../azure-arc/servers/overview.md).
32-
33-
> [!NOTE]
34-
> After installing the Log Analytics agent for Linux, you should not change the permissions of the `sudoers.d` folder or its ownership. Sudo permission is required for the **nxautomation** account, which is the user context the Hybrid Runbook Worker runs under. The permissions should not be removed. Restricting this to certain folders or commands may result in a breaking change.
35-
>
31+
The Hybrid Runbook Worker role requires the [Log Analytics agent](../azure-monitor/agents/log-analytics-agent.md) for the supported Linux operating system. For servers or machines hosted outside of Azure, you can install the Log Analytics agent using [Azure Arc-enabled servers](../azure-arc/servers/overview.md). The agent is installed with certain service accounts that execute commands requiring root permissions. For more information, see [Service accounts](./automation-hrw-run-runbooks.md#service-accounts).
3632

3733
### Supported Linux operating systems
3834

articles/automation/automation-runbook-execution.md

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Runbook execution in Azure Automation
33
description: This article provides an overview of the processing of runbooks in Azure Automation.
44
services: automation
55
ms.subservice: process-automation
6-
ms.date: 08/13/2021
6+
ms.date: 09/15/2021
77
ms.topic: conceptual
88
ms.custom: devx-track-azurepowershell
99
---
@@ -95,19 +95,9 @@ The [Log Analytics agent for Windows](../azure-monitor/agents/agent-windows.md)
9595
9696
### Log Analytics agent for Linux
9797

98-
The [Log Analytics agent for Linux](../azure-monitor/agents/agent-linux.md) works similarly to the agent for Windows, but connects Linux computers to Azure Monitor. The agent is installed with a **nxautomation** user account that allows execution of commands requiring root permissions, for example, on a Hybrid Runbook Worker. The **nxautomation** account is a system account that doesn't require a password.
98+
The [Log Analytics agent for Linux](../azure-monitor/agents/agent-linux.md) works similarly to the agent for Windows, but connects Linux computers to Azure Monitor. The agent is installed with certain service accounts that execute commands requiring root permissions. For more information, see [Service accounts](./automation-hrw-run-runbooks.md#service-accounts).
9999

100-
The **nxautomation** account with the corresponding sudo permissions must be present during [installation of a Linux Hybrid Runbook worker](automation-linux-hrw-install.md). If you try to install the worker and the account is not present or doesn’t have the appropriate permissions, the installation fails.
101-
102-
Do not change the permissions of the `sudoers.d` folder or its ownership. Sudo permission is required for the **nxautomation** account and the permissions should not be removed. Restricting this to certain folders or commands may result in a breaking change.
103-
104-
The logs available for the Log Analytics agent and the **nxautomation** account are:
105-
106-
* /var/opt/microsoft/omsagent/log/omsagent.log - Log Analytics agent log
107-
* /var/opt/microsoft/omsagent/run/automationworker/worker.log - Automation worker log
108-
109-
>[!NOTE]
110-
>The **nxautomation** user enabled as part of Update Management executes only signed runbooks.
100+
The Log Analytics agent log is located at `/var/opt/microsoft/omsagent/log/omsagent.log`.
111101

112102
## Runbook permissions
113103

0 commit comments

Comments
 (0)