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
+17-1Lines changed: 17 additions & 1 deletion
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: 09/30/2021
6
+
ms.date: 11/01/2021
7
7
ms.topic: conceptual
8
8
ms.custom: devx-track-azurepowershell
9
9
---
@@ -27,9 +27,19 @@ Azure Automation handles jobs on Hybrid Runbook Workers differently from jobs ru
27
27
### Windows
28
28
29
29
Jobs for Hybrid Runbook Workers run under the local **System** account.
30
+
>[!NOTE]
31
+
> To run PowerShell 7.x on a Windows Hybrid Runbook Worker, See [Installing PowerShell on Windows](/powershell/scripting/install/installing-powershell-on-windows).
32
+
> Currently, we only support Hybrid worker extension based onboarding as mentioned [here.](/azure/automation/extension-based-hybrid-runbook-worker-install)
33
+
34
+
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.
30
35
31
36
### Linux
32
37
38
+
>[!NOTE]
39
+
> To run PowerShell 7.x on a Linux Hybrid Runbook Worker, See [Installing PowerShell on Linux](/powershell/scripting/install/installing-powershell-on-linux).
40
+
> Currently, we only support Hybrid worker extension based onboarding as mentioned [here.](/azure/automation/extension-based-hybrid-runbook-worker-install)
41
+
42
+
33
43
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
44
35
45
To ensure the service accounts have access to the stored runbook modules:
@@ -220,6 +230,9 @@ You can configure a Windows Hybrid Runbook Worker to run only signed runbooks.
220
230
> [!IMPORTANT]
221
231
> Once you've configured a Hybrid Runbook Worker to run only signed runbooks, unsigned runbooks fail to execute on the worker.
222
232
233
+
> [!NOTE]
234
+
> PowerShell 7.x does not support signed runbooks for Windows and Linux Hybrid Runbook Worker.
235
+
223
236
### Create signing certificate
224
237
225
238
The following example creates a self-signed certificate that can be used for signing runbooks. This code creates the certificate and exports it so that the Hybrid Runbook Worker can import it later. The thumbprint is also returned for later use in referencing the certificate.
@@ -289,6 +302,9 @@ You will perform the following steps to complete this configuration:
289
302
* Verify that signature validation is on
290
303
* Sign a runbook
291
304
305
+
> [!NOTE]
306
+
> PowerShell 7.x does not support signed runbooks for Windows and Linux Hybrid Runbook Worker.
307
+
292
308
### Create a GPG keyring and keypair
293
309
294
310
To create the GPG keyring and keypair, use the Hybrid Runbook Worker [nxautomation account](automation-runbook-execution.md#log-analytics-agent-for-linux).
Copy file name to clipboardExpand all lines: articles/automation/automation-runbook-types.md
+40-2Lines changed: 40 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -54,23 +54,39 @@ You can create and edit graphical and graphical PowerShell Workflow runbooks usi
54
54
55
55
PowerShell runbooks are based on Windows PowerShell. You directly edit the code of the runbook using the text editor in the Azure portal. You can also use any offline text editor and [import the runbook](manage-runbooks.md) into Azure Automation.
56
56
57
+
58
+
The PowerShell version is determined by the **Runtime version** specified (that is version 7.1 preview or 5.1). The Azure Automation service supports the latest PowerShell runtime.
59
+
60
+
The same Azure sandbox and Hybrid Runbook Worker can execute **PowerShell 5.1** and **PowerShell 7.1** runbooks side by side.
61
+
62
+
> [!NOTE]
63
+
> At the time of runbook execution, if you select **Runtime Version** as **7.1 (preview)**, PowerShell modules targeting 7.1 runtime version is used and if you select **Runtime Version** as **5.1**, PowerShell modules targeting 5.1 runtime version are used.
64
+
65
+
Ensure that you select the right Runtime Version for modules.
66
+
67
+
For example : if you are executing a runbook for a Sharepoint automation scenario in **Runtime version***7.1 (preview)*, then import the module in **Runtime version****7.1 (preview)**; if you are executing a runbook for a Sharepoint automation scenario in **Runtime version****5.1**, then import the module in **Runtime version***5.1*. In this case, you would see two entries for the module, one for **Runtime Version****7.1(preview)** and other for **5.1**.
Currently, PowerShell 5.1 and 7.1 (preview) are supported.
58
73
74
+
59
75
### Advantages
60
76
61
77
* Implement all complex logic with PowerShell code without the other complexities of PowerShell Workflow.
62
78
* Start faster than PowerShell Workflow runbooks, since they don't need to be compiled before running.
63
79
* Run in Azure and on Hybrid Runbook Workers for both Windows and Linux.
64
80
65
-
### Limitations
81
+
### Limitations - version 5.1
66
82
67
83
* You must be familiar with PowerShell scripting.
68
84
* Runbooks can't use [parallel processing](automation-powershell-workflow.md#use-parallel-processing) to execute multiple actions in parallel.
69
85
* Runbooks can't use [checkpoints](automation-powershell-workflow.md#use-checkpoints-in-a-workflow) to resume runbook if there's an error.
70
86
* You can include only PowerShell, PowerShell Workflow runbooks, and graphical runbooks as child runbooks by using the [Start-AzAutomationRunbook](/powershell/module/az.automation/start-azautomationrunbook) cmdlet, which creates a new job.
71
87
* Runbooks can't use the PowerShell [#Requires](/powershell/module/microsoft.powershell.core/about/about_requires) statement, it is not supported in Azure sandbox or on Hybrid Runbook Workers and might cause the job to fail.
72
88
73
-
### Known issues
89
+
### Known issues - version 5.1
74
90
75
91
The following are current known issues with PowerShell runbooks:
76
92
@@ -79,6 +95,28 @@ The following are current known issues with PowerShell runbooks:
79
95
* A [Get-Process](/powershell/module/microsoft.powershell.management/get-process) operation in a loop in a PowerShell runbook can crash after about 80 iterations.
80
96
* A PowerShell runbook can fail if it tries to write a large amount of data to the output stream at once. You can typically work around this issue by having the runbook output just the information needed to work with large objects. For example, instead of using `Get-Process` with no limitations, you can have the cmdlet output just the required parameters as in `Get-Process | Select ProcessName, CPU`.
81
97
98
+
### Limitations - 7.1 (preview)
99
+
100
+
- The Azure Automation internal PowerShell cmdlets are not supported on a Linux Hybrid Runbook Worker. You must import the `automationassets` module at the beginning of your Python runbook to access the Automation account shared resources (assets) functions.
101
+
- For the PowerShell 7 runtime version, the module activities are not extracted for the imported modules.
102
+
-*PSCredential* runbook parameter type is not supported in PowerShell 7 runtime version.
103
+
- PowerShell 7.x does not support workflows. See [this](/powershell/scripting/whats-new/differences-from-windows-powershell?view=powershell-7.1#powershell-workflow&preserve-view=true) for more details.
104
+
- PowerShell 7.x currently does not support signed runbooks.
105
+
106
+
### Known Issues - 7.1 (preview)
107
+
108
+
- Executing child scripts using `.\child-runbook.ps1` is not supported in this preview.
109
+
**Workaround**: Use `Start-AutomationRunbook` (internal cmdlet) or `Start-AzAutomationRunbook` (from *Az.Automation* module) to start another runbook from parent runbook.
110
+
- Runbook properties defining logging preference is not supported in PowerShell 7 runtime.
111
+
**Workaround**: Explicitly set the preference at the start of the runbook as below -
112
+
113
+
`$VerbosePreference = "Continue"`
114
+
115
+
`$ProgressPreference = "Continue"`
116
+
117
+
- Avoid importing `Az.Accounts` module to version 2.4.0 version for PowerShell 7 runtime as there can be an unexpected behavior using this version in Azure Automation.
118
+
- You might encounter formatting problems with error output streams for the job running in PowerShell 7 runtime.
119
+
82
120
## PowerShell Workflow runbooks
83
121
84
122
PowerShell Workflow runbooks are text runbooks based on [Windows PowerShell Workflow](automation-powershell-workflow.md). You directly edit the code of the runbook using the text editor in the Azure portal. You can also use any offline text editor and [import the runbook](manage-runbooks.md) into Azure Automation.
Copy file name to clipboardExpand all lines: articles/automation/automation-update-azure-modules.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,11 +31,12 @@ If you develop your scripts locally, it's recommended to have the same module ve
31
31
Currently, updating AZ modules is only available through the portal. Updates through PowerShell and ARM template will be available in the future. Only default Az modules will be updated when performing the following steps:
32
32
33
33
1. Sign in to the [Azure portal](https://portal.azure.com) and navigate to your Automation account.
34
-
1. Under **Shared Resources**, select **PowerShell Modules**.
34
+
1. Under **Shared Resources**, select **Modules**.
35
35
1. Select **Update Az modules**.
36
36
1. Select **Module to Update**. By default, it will show Az module.
37
-
1. From the drop-down list, select **Module Version**.
37
+
1. From the drop-down list, select **Module Version** and **Runtype version**
38
38
1. Select **Update** to update the Az module to the version that you’ve selected.
39
+
On the **Modules** page, you can view the list as shown below:
39
40
40
41
:::image type="content" source="./media/automation-update-azure-modules/update-az-modules-portal.png" alt-text="Update AZ modules page with selections.":::
Copy file name to clipboardExpand all lines: articles/automation/shared-resources/modules.md
+16-6Lines changed: 16 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ title: Manage modules in Azure Automation
3
3
description: This article tells how to use PowerShell modules to enable cmdlets in runbooks and DSC resources in DSC configurations.
4
4
services: automation
5
5
ms.subservice: shared-capabilities
6
-
ms.date: 04/28/2021
6
+
ms.date: 11/01/2021
7
7
ms.topic: conceptual
8
8
ms.custom: devx-track-azurepowershell
9
9
---
@@ -147,19 +147,29 @@ Importing an Az module into your Automation account doesn't automatically import
147
147
148
148
You can import the Az modules into the Automation account from the Azure portal. Because [Az.Accounts](https://www.powershellgallery.com/packages/Az.Accounts/1.1.0) is a dependency for the other Az modules, be sure to import this module before any others.
149
149
150
+
> [!NOTE]
151
+
> With the introduction of **PowerShell 7.1 (preview)** support, the **Browse gallery** option has been updated with the following changes:
152
+
153
+
-**Browse gallery** is available on **Process Automation** > **Modules** blade.
154
+
- The **Modules** page displays two new columns - **Module version** and **Runtime version**
155
+
150
156
1. Sign in to the Azure [portal](https://portal.azure.com).
151
157
1. Search for and select **Automation Accounts**.
152
158
1. On the **Automation Accounts** page, select your Automation account from the list.
153
159
1. From your Automation account, under **Shared Resources**, select **Modules**.
154
-
1. Select **Browse Gallery**.
155
-
1. In the search bar, enter the module name (for example, `Az.Accounts`).
156
-
1. On the PowerShell Module page, select **Import** to import the module into your Automation account.
160
+
1. Select **Add a module**. In the **Add a module** page, you can select either of the following options:
161
+
1.**Browse for file** - selects a file from your local machine.
162
+
1.**Browse from Gallery** - you can browse and select an existing module from gallery.
163
+
1. Click **Select** to select a module.
164
+
1. Select **Runtime version** and click **Import**.
165
+
166
+
:::image type="content" source="../media/modules/import-module.png" alt-text="Screenshot of importing modules into your Automation account.":::
157
167
158
-

168
+
1. On the **Modules** page, you can view the imported module under the Automation account.
159
169
160
170
You can also do this import through the [PowerShell Gallery](https://www.powershellgallery.com), by searching for the module to import. When you find the module, select it, and choose the **Azure Automation** tab. Select **Deploy to Azure Automation**.
161
171
162
-

172
+
:::image type="content" source="../media/modules/import-gallery.png" alt-text="Screenshot of importing modules directly from PowerShell Gallery.":::
0 commit comments