Skip to content

Commit 6c7d50b

Browse files
authored
Merge pull request #178132 from SGSneha/1Nov-Include-module-runbook-version
[Post-Keynote Publish] Included info - add module,note for win/linuxhybrid runbook/runtimeve…
2 parents ccefb33 + 3401302 commit 6c7d50b

File tree

8 files changed

+76
-11
lines changed

8 files changed

+76
-11
lines changed

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

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ 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/30/2021
6+
ms.date: 11/01/2021
77
ms.topic: conceptual
88
ms.custom: devx-track-azurepowershell
99
---
@@ -27,9 +27,19 @@ Azure Automation handles jobs on Hybrid Runbook Workers differently from jobs ru
2727
### Windows
2828

2929
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.
3035

3136
### Linux
3237

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+
3343
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.
3444

3545
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.
220230
> [!IMPORTANT]
221231
> Once you've configured a Hybrid Runbook Worker to run only signed runbooks, unsigned runbooks fail to execute on the worker.
222232
233+
> [!NOTE]
234+
> PowerShell 7.x does not support signed runbooks for Windows and Linux Hybrid Runbook Worker.
235+
223236
### Create signing certificate
224237

225238
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:
289302
* Verify that signature validation is on
290303
* Sign a runbook
291304

305+
> [!NOTE]
306+
> PowerShell 7.x does not support signed runbooks for Windows and Linux Hybrid Runbook Worker.
307+
292308
### Create a GPG keyring and keypair
293309

294310
To create the GPG keyring and keypair, use the Hybrid Runbook Worker [nxautomation account](automation-runbook-execution.md#log-analytics-agent-for-linux).

articles/automation/automation-runbook-types.md

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,23 +54,39 @@ You can create and edit graphical and graphical PowerShell Workflow runbooks usi
5454

5555
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.
5656

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**.
68+
69+
:::image type="content" source="./media/automation-runbook-types/runbook-types.png" alt-text="runbook Types.":::
70+
71+
5772
Currently, PowerShell 5.1 and 7.1 (preview) are supported.
5873

74+
5975
### Advantages
6076

6177
* Implement all complex logic with PowerShell code without the other complexities of PowerShell Workflow.
6278
* Start faster than PowerShell Workflow runbooks, since they don't need to be compiled before running.
6379
* Run in Azure and on Hybrid Runbook Workers for both Windows and Linux.
6480

65-
### Limitations
81+
### Limitations - version 5.1
6682

6783
* You must be familiar with PowerShell scripting.
6884
* Runbooks can't use [parallel processing](automation-powershell-workflow.md#use-parallel-processing) to execute multiple actions in parallel.
6985
* Runbooks can't use [checkpoints](automation-powershell-workflow.md#use-checkpoints-in-a-workflow) to resume runbook if there's an error.
7086
* 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.
7187
* 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.
7288

73-
### Known issues
89+
### Known issues - version 5.1
7490

7591
The following are current known issues with PowerShell runbooks:
7692

@@ -79,6 +95,28 @@ The following are current known issues with PowerShell runbooks:
7995
* A [Get-Process](/powershell/module/microsoft.powershell.management/get-process) operation in a loop in a PowerShell runbook can crash after about 80 iterations.
8096
* 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`.
8197

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+
82120
## PowerShell Workflow runbooks
83121

84122
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.

articles/automation/automation-update-azure-modules.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ If you develop your scripts locally, it's recommended to have the same module ve
3131
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:
3232

3333
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**.
3535
1. Select **Update Az modules**.
3636
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**
3838
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:
3940

4041
:::image type="content" source="./media/automation-update-azure-modules/update-az-modules-portal.png" alt-text="Update AZ modules page with selections.":::
4142

53 KB
Loading
102 KB
Loading
214 KB
Loading
5.04 KB
Loading

articles/automation/shared-resources/modules.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Manage modules in Azure Automation
33
description: This article tells how to use PowerShell modules to enable cmdlets in runbooks and DSC resources in DSC configurations.
44
services: automation
55
ms.subservice: shared-capabilities
6-
ms.date: 04/28/2021
6+
ms.date: 11/01/2021
77
ms.topic: conceptual
88
ms.custom: devx-track-azurepowershell
99
---
@@ -147,19 +147,29 @@ Importing an Az module into your Automation account doesn't automatically import
147147

148148
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.
149149

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+
150156
1. Sign in to the Azure [portal](https://portal.azure.com).
151157
1. Search for and select **Automation Accounts**.
152158
1. On the **Automation Accounts** page, select your Automation account from the list.
153159
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.":::
157167

158-
![Screenshot of importing modules into your Automation account](../media/modules/import-module.png)
168+
1. On the **Modules** page, you can view the imported module under the Automation account.
159169

160170
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**.
161171

162-
![Screenshot of importing modules directly from PowerShell Gallery](../media/modules/import-gallery.png)
172+
:::image type="content" source="../media/modules/import-gallery.png" alt-text="Screenshot of importing modules directly from PowerShell Gallery.":::
163173

164174
### Test your runbooks
165175

0 commit comments

Comments
 (0)