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
@@ -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: 03/15/2022
6
+
ms.date: 03/27/2023
7
7
ms.topic: conceptual
8
8
ms.custom: devx-track-azurepowershell
9
9
---
@@ -25,29 +25,129 @@ Enabling the Azure Firewall on [Azure Storage](../storage/common/storage-network
25
25
26
26
## Plan runbook job behavior
27
27
28
-
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).
28
+
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).
29
29
30
30
## Service accounts
31
31
32
-
### Windows
32
+
### Windows Hybrid Worker
33
33
34
34
Jobs for Hybrid Runbook Workers run under the local **System** account.
35
-
>[!NOTE]
36
-
> To run PowerShell 7.x on a Windows Hybrid Runbook Worker, see [Installing PowerShell on Windows](/powershell/scripting/install/installing-powershell-on-windows).
37
-
> We support [Hybrid worker extension based](./extension-based-hybrid-runbook-worker-install.md) and [agent based](./automation-windows-hrw-install.md) onboarding.
38
-
> For agent based onboarding, ensure the Windows Hybrid Runbook worker version is 7.3.1296.0 or above.
39
35
40
-
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.
36
+
> [!NOTE]
37
+
>- 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.
38
+
>- 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.
> To run PowerShell 7.x on a Linux Hybrid Runbook Worker, see [Installing PowerShell on Linux](/powershell/scripting/install/installing-powershell-on-linux).
46
-
> We support [Hybrid worker extension based](./extension-based-hybrid-runbook-worker-install.md) and [agent based](./automation-linux-hrw-install.md) onboarding.
47
-
> For agent based onboarding, ensure the Linux Hybrid Runbook worker version is 1.7.5.0 or above.
42
+
> [!NOTE]
43
+
> To create environment variable in Windows systems, follow these steps:
44
+
> 1. Go to **Control Panel** > **System** > **Advanced System Settings**.
45
+
> 1. In **System Properties** select **Environment variables**.
46
+
> 1. In **System variables**, select **New**.
47
+
> 1. Provide **Variable name** and **Variable value**, and then select **OK**.
48
+
> 1. Restart the VM or logout from the current user and login to implement the environment variable changes.
49
+
50
+
**PowerShell 7.2**
51
+
52
+
To run PowerShell 7.2 runbooks on a Windows Hybrid Worker, install *PowerShell* on the Hybrid Worker. See [Installing PowerShell on Windows](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3).
53
+
54
+
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 *PowerShell*. Restart the Hybrid Runbook Worker after environment variable is created successfully.
55
+
56
+
**PowerShell 7.1**
57
+
58
+
To run PowerShell 7.1 runbooks on a Windows Hybrid Worker, install *PowerShell* on the Hybrid Worker. See [Installing PowerShell on Windows](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3).
59
+
Ensure to add the *PowerShell* file to the PATH environment variable and restart the Hybrid Runbook Worker after the installation.
60
+
61
+
**Python 3.10**
62
+
63
+
To run Python 3.10 runbooks on a Windows Hybrid Worker, install *Python* on the Hybrid Worker. See [Installing Python on Windows](https://docs.python.org/3/using/windows.html).
64
+
65
+
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*. Restart the Hybrid Runbook Worker after environment variable is created successfully.
66
+
67
+
**Python 3.8**
68
+
69
+
To run Python 3.8 runbooks on a Windows Hybrid Worker, install Python on the Hybrid Worker. See [Installing Python on Windows](https://docs.python.org/3/using/windows.html). Create **environment variable***PYTHON_3_PATH* for Python 3.8 runbooks and ensure to add the location of executable Python as **Variable value**. Restart the Hybrid Runbook Worker after the environment variable is created successfully.
70
+
71
+
If the *Python* executable file is at the default location *C:\WPy64-3800\python-3.8.0.amd64\python.exe*, then you do not have to create the environment variable.
72
+
73
+
74
+
**Python 2.7**
75
+
76
+
To run Python 2.7 runbooks on a Windows Hybrid Worker, install Python on the Hybrid Worker. See [Installing Python on Windows](https://docs.python.org/3/using/windows.html). Create **environment variable***PYTHON_2_PATH* for Python 2.7 runbooks and ensure to add the location of executable Python file as **Variable value**. Restart the Hybrid Runbook Worker after the environment variable is created successfully.
77
+
78
+
If the *Python* executable file is at the default location *C:\Python27\python.exe*, then you do not have to create the environment variable.
> To create environment variable in Windows systems, follow these steps:
84
+
> 1. Go to **Control Panel** > **System** > **Advanced System Settings**.
85
+
> 1. In **System Properties** select **Environment variables**.
86
+
> 1. In **System variables**, select **New**.
87
+
> 1. Provide **Variable name** and **Variable value**, and then select **OK**.
88
+
> 1. Restart the VM or logout from the current user and login to implement the environment variable changes.
89
+
90
+
**PowerShell 7.1**
91
+
92
+
To run PowerShell 7.1 runbooks on a Windows Hybrid Worker, install *PowerShell* on the Hybrid Worker. See [Installing PowerShell on Windows](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.3).
93
+
Ensure to add the *PowerShell* file to the PATH environment variable and restart the Hybrid Runbook Worker after the installation.
94
+
95
+
**Python 3.8**
96
+
97
+
To run Python 3.8 runbooks on a Windows Hybrid Worker, install Python on the Hybrid Worker. See [Installing Python on Windows](https://docs.python.org/3/using/windows.html). Create **environment variable***PYTHON_3_PATH* for Python 3.8 runbooks and ensure to add the location of executable Python as **Variable value**. Restart the Hybrid Runbook Worker after the environment variable is created successfully.
48
98
99
+
If the *Python* executable file is at the default location *C:\WPy64-3800\python-3.8.0.amd64\python.exe*, then you do not have to create the environment variable.
49
100
50
-
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.
101
+
102
+
**Python 2.7**
103
+
104
+
To run Python 2.7 runbooks on a Windows Hybrid Worker, install Python on the Hybrid Worker. See [Installing Python on Windows](https://docs.python.org/3/using/windows.html). Create **environment variable***PYTHON_2_PATH* for Python 2.7 runbooks and ensure to add the location of executable Python file as **Variable value**. Restart the Hybrid Runbook Worker after the environment variable is created successfully.
105
+
106
+
If the *Python* executable file is at the default location *C:\Python27\python.exe*, then you do not have to create the environment variable.
107
+
108
+
---
109
+
110
+
### Linux Hybrid Worker
111
+
112
+
> [!NOTE]
113
+
>- 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.
114
+
>- 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.
> To create environment variable in Linux systems, follow these steps:
120
+
> 1. Open /etc/environment.
121
+
> 1. 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).
122
+
> 1. Restart the VM or logout from current user and login after saving the changes to /etc/environment to implement environment variable changes.
123
+
124
+
**PowerShell 7.2**
125
+
126
+
To run PowerShell 7.2 runbooks on a Linux Hybrid Worker, install *PowerShell* 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).
127
+
128
+
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 *PowerShell* file. Restart the Hybrid Runbook Worker after an environment variable is created successfully.
129
+
130
+
**Python 3.10**
131
+
132
+
To run Python 3.10 runbooks on a Linux Hybrid Worker, install *Python* on the Hybrid Worker. For more information, see [Installing Python 3.10 on Linux](https://docs.python.org/3/using/unix.html).
133
+
134
+
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* file. Restart the Hybrid Runbook Worker after environment variable is created successfully.
135
+
136
+
**Python 3.8**
137
+
138
+
To run Python 3.8 runbooks on a Linux Hybrid Worker, install *Python* on the Hybrid Worker.
139
+
Ensure to add the executable *Python* file to the PATH environment variable and restart the Hybrid Runbook Worker after the installation.
140
+
141
+
**Python 2.7**
142
+
143
+
To run Python 2.7 runbooks on a Linux Hybrid Worker, install *Python* on the Hybrid Worker.
144
+
Ensure to add the executable *Python* file to the PATH environment variable and restart the Hybrid Runbook Worker after the installation.
Create Service accounts **nxautomation** and **omsagent** for agent-based Hybrid Workers. The creation and permission assignment script can be viewed at [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).
149
+
150
+
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.
51
151
52
152
To ensure the service accounts have access to the stored runbook modules:
53
153
@@ -56,7 +156,7 @@ To ensure the service accounts have access to the stored runbook modules:
56
156
57
157
The Automation worker log is located at `/var/opt/microsoft/omsagent/run/automationworker/worker.log`.
58
158
59
-
The service accounts are removed when the machine is removed as a Hybrid Runbook Worker.
0 commit comments