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-hrw-run-runbooks.md
+64-13Lines changed: 64 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Run Azure Automation runbooks on a Hybrid Runbook Worker
3
3
description: This article describes how to run runbooks on machines in your local datacenter or other cloud provider with the Hybrid Runbook Worker.
4
4
services: automation
5
5
ms.subservice: process-automation
6
-
ms.date: 11/18/2022
6
+
ms.date: 03/17/2023
7
7
ms.topic: conceptual
8
8
ms.custom: devx-track-azurepowershell
9
9
---
@@ -24,29 +24,80 @@ Enabling the Azure Firewall on [Azure Storage](../storage/common/storage-network
24
24
25
25
## Plan runbook job behavior
26
26
27
-
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).
27
+
Azure Automation handles jobs on Hybrid Runbook Workers differently from jobs run in cloud 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).
28
28
29
29
## Service accounts
30
30
31
-
### Windows
31
+
### Windows Hybrid Worker
32
32
33
33
Jobs for Hybrid Runbook Workers run under the local **System** account.
34
+
34
35
>[!NOTE]
35
-
> To run PowerShell 7.x on a Windows Hybrid Runbook Worker, see [Installing PowerShell on Windows](/powershell/scripting/install/installing-powershell-on-windows).
36
-
> We support [Hybrid worker extension based](./extension-based-hybrid-runbook-worker-install.md) and [agent based](./automation-windows-hrw-install.md) onboarding.
37
-
> For agent based onboarding, ensure the Windows Hybrid Runbook worker version is 7.3.1296.0 or above.
36
+
>- PowerShell 5.1, PowerShell 7.1(preview), Python 2.7, and Python 3.8(preview) runbooks are supported on both extension-based and agent-based Windows Hybrid Runbook Workers. For agent based workers, ensure the Windows Hybrid worker version is 7.3.12960 or above.
37
+
>- PowerShell 7.2 (preview) and Python 3.10 (preview) runbooks are supported on extension-based Windows Hybrid Workers only. Ensure the Windows Hybrid worker extension version is 1.1.11 or above.
Make sure the path where the *pwsh.exe* executable is located and is added to the PATH environment variable. Restart the Hybrid Runbook Worker after installation is completed.
42
+
43
+
**PowerShell 7.1**
44
+
Make sure the path where the *pwsh.exe* executable is located and is added to the PATH environment variable. Restart the Hybrid Runbook Worker after the installation completes.
45
+
46
+
**Python 2.x, Python 3.x upto 3.8**
47
+
Make sure the path where the *python.exe* executable is located and is added to the PATH environment variable. Restart the Hybrid Runbook Worker after the installation completes.
48
+
49
+
**PowerShell 7.2**
50
+
To run PowerShell 7.2 runbooks on a Windows Hybrid Worker, install *pwsh.exe* on the Hybrid Worker. See [Installing PowerShell on Windows]().
51
+
52
+
After PowerShell 7.2 installation is complete, create an environment variable with Variable name as powershell_7_2_path and Variable value as location of the executable *pwsh.exe*. Restart the Hybrid Runbook Worker after environment variable is created successfully.
38
53
39
-
Make sure the path where the *pwsh.exe* executable is located and is added to the PATH environment variable. Restart the Hybrid Runbook Worker after installation completes.
54
+
**Python 3.10**
55
+
To run Python 3.10 runbooks on a Windows Hybrid Worker, install *python.exe* on the Hybrid Worker. See [Installing Python on Windows]().
56
+
57
+
After Python 3.10 installation is complete, create an environment variable with Variable name as python_3_10_path and Variable value as location of the executable *python.exe*. Restart the Hybrid Runbook Worker after environment variable is created successfully.
Make sure the path where the *pwsh.exe* executable is located and is added to the PATH environment variable. Restart the Hybrid Runbook Worker after the installation completes.
63
+
64
+
**Python 2.x, Python 3.x upto 3.8**
65
+
Make sure the path where the *python.exe executable is located and is added to the PATH environment variable. Restart the Hybrid Runbook Worker after the installation completes.
66
+
67
+
---
40
68
41
-
### Linux
69
+
### Linux Hybrid Worker
42
70
43
71
>[!NOTE]
44
-
> To run PowerShell 7.x on a Linux Hybrid Runbook Worker, see [Installing PowerShell on Linux](/powershell/scripting/install/installing-powershell-on-linux).
45
-
> We support [Hybrid worker extension based](./extension-based-hybrid-runbook-worker-install.md) and [agent based](./automation-linux-hrw-install.md) onboarding.
46
-
> For agent based onboarding, ensure the Linux Hybrid Runbook worker version is 1.7.5.0 or above.
72
+
>- PowerShell 5.1, PowerShell 7.1(preview), Python 2.7, Python 3.8 (preview) runbooks are supported on both extension-based and agent-based Linux Hybrid Runbook Workers. For agent-based workers, ensure the Linux Hybrid Runbook worker version is 1.7.5.0 or above.
73
+
>- PowerShell 7.2 (preview) and Python 3.10 (preview) runbooks are supported on extension-based Linux Hybrid Workers only. Ensure the Linux Hybrid worker extension version is 1.1.11 or above.
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.
77
+
>[!NOTE]
78
+
> Create environment variable in Linux systems: </br> 1. Open /etc/environment. </br> 2. Create a new Environment variable by adding VARIABLE_NAME="variable_value" in a new line in /etc/environment (VARIABLE_NAME is the name of the new Environment variable and variable_value represents the value it is to be assigned). </br> 3. Either restart the VM or logout from current user and login again after saving the changes to /etc/environment to ensure environment variable changes take place.
79
+
80
+
**Python 2.x, Python 3.x upto 3.8**
81
+
Make sure the path where the **python.exe* executable file is located and added to the PATH environment variable. Restart the Hybrid Runbook Worker after the installation is complete.
82
+
83
+
**PowerShell 7.2**
84
+
To run PowerShell 7.2 runbooks on a Linux Hybrid Worker, install *pwsh.exe* file on the Hybrid Worker. For more information, see [Installing PowerShell on Linux](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-linux?view=powershell-7.3).
85
+
86
+
After PowerShell 7.2 installation is complete, create an environment variable with **Variable name** as *powershell_7_2_path* and **Variable value** as location of the executable *pwsh.exe*.
87
+
88
+
Restart the Hybrid Runbook Worker after an environment variable is created successfully.
89
+
90
+
**Python 3.10**
91
+
To run Python 3.10 runbooks on a Linux Hybrid Worker, install *python.exe* on the Hybrid Worker. For more information, see [Installing Python 3.10 on Linux]()
92
+
93
+
After Python 3.10 installation is complete, create an environment variable with **Variable name** as *python_3_10_path* and **Variable value** as location of the executable *python.exe* file. Restart the Hybrid Runbook Worker after environment variable is created successfully.
Create Service accounts **nxautomation** and **omsagent** for agent-based Hybrid Workers. 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).
99
+
100
+
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.
50
101
51
102
To ensure the service accounts have access to the stored runbook modules:
52
103
@@ -55,7 +106,7 @@ To ensure the service accounts have access to the stored runbook modules:
55
106
56
107
The Automation worker log is located at `/var/opt/microsoft/omsagent/run/automationworker/worker.log`.
57
108
58
-
The service accounts are removed when the machine is removed as a Hybrid Runbook Worker.
0 commit comments