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/analysis-services/analysis-services-refresh-azure-automation.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -168,7 +168,7 @@ An Azure Virtual Machine with a static public IP address can be used as an Azure
168
168
> [!IMPORTANT]
169
169
> Ensure the Virtual Machine public IP address is configured as static.
170
170
>
171
-
>To learn more about configuring Azure Automation Hybrid Workers, see [Automate resources in your datacenter or cloud by using Hybrid Runbook Worker](../automation/automation-hybrid-runbook-worker.md#install-a-hybrid-runbook-worker).
171
+
>To learn more about configuring Azure Automation Hybrid Workers, see [Installation of a Hybrid Runbook Worker](../automation/automation-hybrid-runbook-worker.md#installation-of-a-hybrid-runbook-worker).
172
172
173
173
Once a Hybrid Worker is configured, create a Webhook as described in the section [Consume with Data Factory](#consume-with-data-factory). The only difference here is to select the **Run on** > **Hybrid Worker** option when configuring the Webhook.
Copy file name to clipboardExpand all lines: articles/automation/automation-hrw-run-runbooks.md
+41-42Lines changed: 41 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
2
title: Run runbooks on Azure Automation Hybrid Runbook Worker
3
-
description: This article provides information about running runbooks on machines in your local datacenter or cloud provider with the Hybrid Runbook Worker role.
3
+
description: This article provides information about running runbooks on machines in your local datacenter or cloud provider with the Hybrid Runbook Worker.
4
4
services: automation
5
5
ms.subservice: process-automation
6
6
ms.date: 01/29/2019
7
7
ms.topic: conceptual
8
8
---
9
-
# Running runbooks on a Hybrid Runbook Worker
9
+
# Run runbooks on a Hybrid Runbook Worker
10
10
11
11
Runbooks that target a Hybrid Runbook Worker typically manage resources on the local computer or against resources in the local environment where the worker is deployed. Runbooks in Azure Automation typically manage resources in the Azure cloud. Even though they are used differently, runbooks that run in Azure Automation and runbooks that run on a Hybrid Runbook Worker are identical in structure.
12
12
@@ -15,15 +15,23 @@ When you author a runbook to run on a Hybrid Runbook Worker, you should edit and
15
15
>[!NOTE]
16
16
>This article has been updated to use the new Azure PowerShell Az module. You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. To learn more about the new Az module and AzureRM compatibility, see [Introducing the new Azure PowerShell Az module](https://docs.microsoft.com/powershell/azure/new-azureps-module-az?view=azps-3.5.0). For Az module installation instructions on your Hybrid Runbook Worker, see [Install the Azure PowerShell Module](https://docs.microsoft.com/powershell/azure/install-az-ps?view=azps-3.5.0). For your Automation account, you can update your modules to the latest version using [How to update Azure PowerShell modules in Azure Automation](automation-update-azure-modules.md).
17
17
18
-
## Runbook permissions for a Hybrid Runbook Worker
18
+
## Plan runbook job behavior
19
19
20
-
As they are accessing non-Azure resources, runbooks running on a Hybrid Runbook Worker can't use the authentication mechanism typically used by runbooks authenticating to Azure resources. A runbook either provides its own authentication to local resources, or configures authentication using [managed identities for Azure resources](../active-directory/managed-identities-azure-resources/tutorial-windows-vm-access-arm.md#grant-your-vm-access-to-a-resource-group-in-resource-manager). You can also specify a Run As account to provide a user context for all runbooks.
20
+
Azure Automation handles jobs on Hybrid Runbook Workers somewhat 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).
21
21
22
-
### Runbook authentication
22
+
Remember that jobs for Hybrid Runbook Workers run under the local **System** account on Windows or the **nxautomation** account on Linux. For Linux, ensure that the **nxautomation** account has access to the location where the runbook modules are stored. When you use the [Install-Module](/powershell/module/powershellget/install-module) cmdlet, be sure to specify AllUsers for the `Scope` parameter to ensure that the **nxautomation** account has access. For more information on PowerShell on Linux, see [Known Issues for PowerShell on Non-Windows Platforms](https://docs.microsoft.com/powershell/scripting/whats-new/known-issues-ps6?view=powershell-6#known-issues-for-powershell-on-non-windows-platforms).
23
23
24
-
By default, runbooks run on the local computer. For Windows, they run in the context of the local **System** account. For Linux, they run in the context of the special user account **nxautomation**. In either scenario, the runbooks must provide their own authentication to resources that they access.
24
+
## Set up runbook permissions
25
25
26
-
You can use [Credential](automation-credentials.md) and [Certificate](automation-certificates.md) assets in your runbook with cmdlets that allow you to specify credentials so that the runbook can authenticate to different resources. The following example shows a portion of a runbook that restarts a computer. It retrieves credentials from a credential asset and the name of the computer from a variable asset and then uses these values with the `Restart-Computer` cmdlet.
26
+
You define permissions for your runbook to run on the Hybrid Runbook Manager in the following ways:
27
+
28
+
* Have the runbook provide its own authentication to local resources.
29
+
* Configure authentication using [managed identities for Azure resources](../active-directory/managed-identities-azure-resources/tutorial-windows-vm-access-arm.md#grant-your-vm-access-to-a-resource-group-in-resource-manager).
30
+
* Specify a Run As account to provide a user context for all runbooks.
31
+
32
+
## Use runbook authentication to local resources
33
+
34
+
If preparing a runbook that provides its own authentication to resources, use [Credential](automation-credentials.md) and [Certificate](automation-certificates.md) assets in your runbook. There are several cmdlets that allow you to specify credentials so that the runbook can authenticate to different resources. The following example shows a portion of a runbook that restarts a computer. It retrieves credentials from a credential asset and the name of the computer from a variable asset and then uses these values with the `Restart-Computer` cmdlet.
You can also use an [InlineScript](automation-powershell-workflow.md#inlinescript) activity. `InlineScript` allows you to run blocks of code on another computer with credentials specified by the [PSCredential common parameter](/powershell/module/psworkflow/about/about_workflowcommonparameters).
36
44
37
-
### Run As account
38
-
39
-
Instead of having your runbook provide its own authentication to local resources, you can specify a Run As account for a Hybrid Runbook Worker group. To do this, you must define a [credential asset](automation-credentials.md) that has access to local resources. These resources include certificate stores and all runbooks run under these credentials on a Hybrid Runbook Worker in the group.
40
-
41
-
The user name for the credential must be in one of the following formats:
42
-
43
-
* domain\username
44
-
* username@domain
45
-
* username (for accounts local to the on-premises computer)
46
-
47
-
Use the following procedure to specify a Run As account for a Hybrid Runbook Worker group.
48
-
49
-
1. Create a [credential asset](automation-credentials.md) with access to local resources.
50
-
2. Open the Automation account in the Azure portal.
51
-
3. Select the **Hybrid Worker Groups** tile, and then select the group.
52
-
4. Select **All settings**, followed by **Hybrid worker group settings**.
53
-
5. Change the value of **Run As** from **Default** to **Custom**.
54
-
6. Select the credential and click **Save**.
55
-
56
-
### <aname="managed-identities-for-azure-resources"></a>Managed Identities for Azure Resources
45
+
## <aname="runbook-auth-managed-identities"></a>Use runbook authentication with managed identities
57
46
58
47
Hybrid Runbook Workers on Azure virtual machines can use managed identities for Azure resources to authenticate to Azure resources. Using managed identities for Azure resources instead of Run As accounts provides benefits because you don't need to:
59
48
@@ -80,7 +69,26 @@ Follow the next steps to use a managed identity for Azure resources on a Hybrid
80
69
> [!NOTE]
81
70
> `Connect-AzAccount -Identity` works for a Hybrid Runbook Worker using a system-assigned identity and a single user-assigned identity. If you use multiple user-assigned identities on the Hybrid Runbook Worker, your runbook must specify the `AccountId` parameter for `Connect-AzAccount` to select a specific user-assigned identity.
82
71
83
-
### <aname="runas-script"></a>Automation Run As account
72
+
## Use runbook authentication with Run As account
73
+
74
+
Instead of having your runbook provide its own authentication to local resources, you can specify a Run As account for a Hybrid Runbook Worker group. To do this, you must define a [credential asset](automation-credentials.md) that has access to local resources. These resources include certificate stores and all runbooks run under these credentials on a Hybrid Runbook Worker in the group.
75
+
76
+
The user name for the credential must be in one of the following formats:
77
+
78
+
* domain\username
79
+
* username@domain
80
+
* username (for accounts local to the on-premises computer)
81
+
82
+
Use the following procedure to specify a Run As account for a Hybrid Runbook Worker group.
83
+
84
+
1. Create a [credential asset](automation-credentials.md) with access to local resources.
85
+
2. Open the Automation account in the Azure portal.
86
+
3. Select the **Hybrid Worker Groups** tile, and then select the group.
87
+
4. Select **All settings**, followed by **Hybrid worker group settings**.
88
+
5. Change the value of **Run As** from **Default** to **Custom**.
89
+
6. Select the credential and click **Save**.
90
+
91
+
### <aname="runas-script"></a>Install Run As account certificate
84
92
85
93
As part of your automated build process for deploying resources in Azure, you might require access to on-premises systems to support a task or set of steps in your deployment sequence. To provide authentication against Azure using the Run As account, you must install the Run As account certificate.
86
94
@@ -165,17 +173,9 @@ To finish preparing the Run As account:
165
173
5. Run the runbook, targeting the Hybrid Runbook Worker group that runs and authenticates runbooks using the Run As account.
166
174
6. Examine the job stream to see that it reports the attempt to import the certificate into the local machine store, and follows with multiple lines. This behavior depends on how many Automation accounts you define in your subscription and the degree of success of the authentication.
167
175
168
-
## Job behavior on Hybrid Runbook Workers
169
-
170
-
Azure Automation handles jobs on Hybrid Runbook Workers somewhat differently from jobs run in Azure sandboxes. One key difference is that there's no limit on job duration on the runbook workers. Runbooks run in Azure sandboxes are limited to three hours because of [fair share](automation-runbook-execution.md#fair-share).
171
-
172
-
For a long-running runbook, you want to make sure that it's resilient to possible restart, for example, if the machine that hosts the worker reboots. If the Hybrid Runbook Worker host machine reboots, any running runbook job restarts from the beginning, or from the last checkpoint for PowerShell Workflow runbooks. After a runbook job is restarted more than three times, it is suspended.
173
-
174
-
Remember that jobs for Hybrid Runbook Workers run under the local System account on Windows or the **nxautomation** account on Linux. For Linux, you must ensure that the **nxautomation** account has access to the location where the runbook modules are stored. When you use the [Install-Module](/powershell/module/powershellget/install-module) cmdlet, be sure to specify AllUsers for the `Scope` parameter to ensure that the **nxautomation** account has access. For more information on PowerShell on Linux, see [Known Issues for PowerShell on Non-Windows Platforms](https://docs.microsoft.com/powershell/scripting/whats-new/known-issues-ps6?view=powershell-6#known-issues-for-powershell-on-non-windows-platforms).
175
-
176
-
## Starting a runbook on a Hybrid Runbook Worker
176
+
## Start a runbook on a Hybrid Runbook Worker
177
177
178
-
[Starting a runbook in Azure Automation](automation-starting-a-runbook.md) describes different methods for starting a runbook. Startup for a runbook on a Hybrid Runbook Worker uses a **Run on** option that allows you to specify the name of a Hybrid Runbook Worker group. When a group is specified, one of the workers in that group retrieves and runs the runbook. If your runbook does not specify this option, Azure Automation runs the runbook as usual.
178
+
[Start a runbook in Azure Automation](start-runbooks.md) describes different methods for starting a runbook. Startup for a runbook on a Hybrid Runbook Worker uses a **Run on** option that allows you to specify the name of a Hybrid Runbook Worker group. When a group is specified, one of the workers in that group retrieves and runs the runbook. If your runbook does not specify this option, Azure Automation runs the runbook as usual.
179
179
180
180
When you start a runbook in the Azure portal, you're presented with the **Run on** option for which you can select **Azure** or **Hybrid Worker**. If you select **Hybrid Worker**, you can choose the Hybrid Runbook Worker group from a dropdown.
> You should [download the latest PowerShell version](https://azure.microsoft.com/downloads/) if you have an earlier one installed. Only install this version on the workstation where you are starting the runbook from PowerShell. You do not need to install it on the Hybrid Runbook Worker computer unless you intend to start runbooks from this computer.
190
190
191
-
## Working with signed runbooks on a Windows Hybrid Runbook Worker
191
+
## Work with signed runbooks on a Windows Hybrid Runbook Worker
192
192
193
193
You can configure a Windows Hybrid Runbook Worker to run only signed runbooks.
194
194
195
195
> [!IMPORTANT]
196
196
> Once you have configured a Hybrid Runbook Worker to run only signed runbooks, runbooks that have not been signed will fail to execute on the worker.
197
197
198
-
### Create Signing Certificate
198
+
### Create signing certificate
199
199
200
200
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.
When a runbook has been signed, you must import it into your Automation account and publish it with the signature block. To learn how to import runbooks, see [Importing a runbook from a file into Azure Automation](manage-runbooks.md#importing-a-runbook).
250
250
251
-
## Working with signed runbooks on a Linux Hybrid Runbook Worker
251
+
## Work with signed runbooks on a Linux Hybrid Runbook Worker
252
252
253
253
To be able to work with signed runbooks, a Linux Hybrid Runbook Worker must have the [GPG](https://gnupg.org/index.html) executable on the local machine.
254
254
@@ -307,7 +307,6 @@ You can now upload the signed runbook to Azure Automation and execute it like a
307
307
308
308
## Next steps
309
309
310
-
* To learn more about the methods forstarting a runbook, see [Starting a Runbookin Azure Automation](automation-starting-a-runbook.md).
311
310
* To understand how to use the textual editor to work with PowerShell runbooks in Azure Automation, see [Editing a Runbook in Azure Automation](automation-edit-textual-runbook.md).
312
311
* If your runbooks aren't completing successfully, review the troubleshooting guide for [runbook execution failures](troubleshoot/hybrid-runbook-worker.md#runbook-execution-fails).
313
312
* For more information on PowerShell, including language reference and learning modules, refer to the [PowerShell Docs](https://docs.microsoft.com/powershell/scripting/overview).
0 commit comments