Skip to content

Commit 34ba64e

Browse files
authored
Merge pull request #303098 from jasminemehndir/automation-update-22July
Content update
2 parents c29af44 + 5b54319 commit 34ba64e

File tree

1 file changed

+24
-56
lines changed

1 file changed

+24
-56
lines changed

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

Lines changed: 24 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: Run Azure Automation runbooks on a Hybrid Runbook Worker
2+
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: 05/05/2025
6+
ms.date: 07/22/2025
77
ms.topic: how-to
88
ms.custom: devx-track-azurepowershell, linux-related-content
99
ms.service: azure-automation
@@ -44,7 +44,7 @@ Jobs for Hybrid Runbook Workers run under the local **System** account.
4444
>- PowerShell 5.1, PowerShell 7.1(preview), Python 2.7, and Python 3.8 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.
4545
>- PowerShell 7.2 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.
4646
47-
#### [Extension-based Hybrid Workers](#tab/win-extn-hrw)
47+
#### Extension-based Hybrid Workers
4848

4949
> [!NOTE]
5050
> To create environment variable in Windows systems, follow these steps:
@@ -54,89 +54,72 @@ Jobs for Hybrid Runbook Workers run under the local **System** account.
5454
> 1. Provide **Variable name** and **Variable value**, and then select **OK**.
5555
> 1. Restart the VM or logout from the current user and login to implement the environment variable changes.
5656
57+
**PowerShell 7.4**
58+
59+
To run PowerShell 7.4 runbooks on a Windows Hybrid Worker, install *PowerShell* on the Hybrid Worker. See [Install PowerShell on Windows](/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.5).
60+
61+
After PowerShell 7.4 installation is complete, create an environment variable with Variable name as powershell_7_4_path and Variable value as location of the executable *PowerShell*. Restart the Hybrid Runbook Worker after environment variable is created successfully.
62+
5763
**PowerShell 7.2**
5864

59-
To run PowerShell 7.2 runbooks on a Windows Hybrid Worker, install *PowerShell* on the Hybrid Worker. See [Installing PowerShell on Windows](/powershell/scripting/install/installing-powershell-on-windows).
65+
To run PowerShell 7.2 runbooks on a Windows Hybrid Worker, install *PowerShell* on the Hybrid Worker. See [Install PowerShell on Windows](/powershell/scripting/install/installing-powershell-on-windows).
6066

6167
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.
6268

6369
**PowerShell 7.1**
6470

65-
To run PowerShell 7.1 runbooks on a Windows Hybrid Worker, install *PowerShell* on the Hybrid Worker. See [Installing PowerShell on Windows](/powershell/scripting/install/installing-powershell-on-windows).
71+
To run PowerShell 7.1 runbooks on a Windows Hybrid Worker, install *PowerShell* on the Hybrid Worker. See [Install PowerShell on Windows](/powershell/scripting/install/installing-powershell-on-windows).
6672
Ensure to add the *PowerShell* file to the PATH environment variable and restart the Hybrid Runbook Worker after the installation.
6773

6874
**Python 3.10**
6975

70-
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).
76+
To run Python 3.10 runbooks on a Windows Hybrid Worker, install *Python* on the Hybrid Worker. See [Install Python on Windows](https://docs.python.org/3/using/windows.html).
7177

7278
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.
7379

7480
**Python 3.8**
7581

76-
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.
82+
To run Python 3.8 runbooks on a Windows Hybrid Worker, install Python on the Hybrid Worker. See [Install 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.
7783

7884
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.
7985

8086

8187
**Python 2.7**
8288

83-
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.
89+
To run Python 2.7 runbooks on a Windows Hybrid Worker, install Python on the Hybrid Worker. See [Install 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.
8490

8591
If the *Python* executable file is at the default location *C:\Python27\python.exe*, then you do not have to create the environment variable.
8692

87-
#### [Agent-based Hybrid Workers](#tab/win-agt-hrw)
88-
89-
> [!NOTE]
90-
> To create environment variable in Windows systems, follow these steps:
91-
> 1. Go to **Control Panel** > **System** > **Advanced System Settings**.
92-
> 1. In **System Properties** select **Environment variables**.
93-
> 1. In **System variables**, select **New**.
94-
> 1. Provide **Variable name** and **Variable value**, and then select **OK**.
95-
> 1. Restart the VM or logout from the current user and login to implement the environment variable changes.
96-
97-
**PowerShell 7.1**
98-
99-
To run PowerShell 7.1 runbooks on a Windows Hybrid Worker, install *PowerShell* on the Hybrid Worker. See [Installing PowerShell on Windows](/powershell/scripting/install/installing-powershell-on-windows).
100-
Ensure to add the *PowerShell* file to the PATH environment variable and restart the Hybrid Runbook Worker after the installation.
101-
102-
**Python 3.8**
103-
104-
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.
105-
106-
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.
107-
108-
109-
**Python 2.7**
110-
111-
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.
112-
113-
If the *Python* executable file is at the default location *C:\Python27\python.exe*, then you do not have to create the environment variable.
114-
115-
---
11693

11794
### Linux Hybrid Worker
11895

11996
> [!NOTE]
12097
>- PowerShell 5.1, PowerShell 7.1(preview), Python 2.7, Python 3.8 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.
12198
>- PowerShell 7.2 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.
12299
123-
#### [Extension-based Hybrid Workers](#tab/Lin-extn-hrw)
100+
#### Extension-based Hybrid Workers
124101

125102
> [!NOTE]
126103
> To create environment variable in Linux systems, follow these steps:
127104
> 1. Open /etc/environment.
128105
> 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).
129106
> 1. Restart the VM or logout from current user and login after saving the changes to /etc/environment to implement environment variable changes.
130107
108+
**PowerShell 7.4**
109+
110+
To run PowerShell 7.4 runbooks on a Linux Hybrid Worker, install *PowerShell* file on the Hybrid Worker. See [Install PowerShell on Linux](/powershell/scripting/install/installing-powershell-on-linux?view=powershell-7.5).
111+
112+
After PowerShell 7.4 installation is complete, create an environment variable with **Variable name** as powershell_7_4_path and **Variable value** as location of the executable *PowerShell* file. Restart the Hybrid Runbook Worker after an environment variable is created successfully.
113+
131114
**PowerShell 7.2**
132115

133-
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](/powershell/scripting/install/installing-powershell-on-linux).
116+
To run PowerShell 7.2 runbooks on a Linux Hybrid Worker, install *PowerShell* file on the Hybrid Worker. For more information, see [Install PowerShell on Linux](/powershell/scripting/install/installing-powershell-on-linux).
134117

135118
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.
136119

137120
**Python 3.10**
138121

139-
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).
122+
To run Python 3.10 runbooks on a Linux Hybrid Worker, install *Python* on the Hybrid Worker. For more information, see [Install Python 3.10 on Linux](https://docs.python.org/3/using/unix.html).
140123

141124
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.
142125

@@ -150,21 +133,6 @@ Ensure to add the executable *Python* file to the PATH environment variable and
150133
To run Python 2.7 runbooks on a Linux Hybrid Worker, install *Python* on the Hybrid Worker.
151134
Ensure to add the executable *Python* file to the PATH environment variable and restart the Hybrid Runbook Worker after the installation.
152135

153-
#### [Agent-based Hybrid Workers](#tab/Lin-agt-hrw)
154-
155-
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).
156-
157-
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.
158-
159-
To ensure the service accounts have access to the stored runbook modules:
160-
161-
- 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>`.
162-
- 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.
163-
164-
The Automation worker log is located at `/var/opt/microsoft/omsagent/run/automationworker/worker.log`.
165-
166-
---
167-
168136
## Configure runbook permissions
169137

170138
Define permissions for your runbook to run on the Hybrid Runbook Worker in the following ways:
@@ -434,7 +402,7 @@ You will perform the following steps to complete this configuration:
434402
> [!NOTE]
435403
> The Create a GPG keyring and keypair are applicable only for the agent-based hybrid workers.
436404
437-
To create the GPG keyring and keypair, use the Hybrid Runbook Worker.
405+
To create the GPG keyring and keypair, use the Hybrid Runbook Worker:
438406

439407
1. Use the sudo application to sign in as the **nxautomation** account.
440408

0 commit comments

Comments
 (0)