Skip to content

Commit 96331ad

Browse files
authored
Merge pull request #113824 from BethWilke/branch141
Fixing task 1667836
2 parents 6f9c890 + 6058df2 commit 96331ad

11 files changed

+145
-135
lines changed

articles/analysis-services/analysis-services-refresh-azure-automation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ An Azure Virtual Machine with a static public IP address can be used as an Azure
168168
> [!IMPORTANT]
169169
> Ensure the Virtual Machine public IP address is configured as static.
170170
>
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).
172172
173173
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.
174174

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

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
---
22
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.
44
services: automation
55
ms.subservice: process-automation
66
ms.date: 01/29/2019
77
ms.topic: conceptual
88
---
9-
# Running runbooks on a Hybrid Runbook Worker
9+
# Run runbooks on a Hybrid Runbook Worker
1010

1111
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.
1212

@@ -15,15 +15,23 @@ When you author a runbook to run on a Hybrid Runbook Worker, you should edit and
1515
>[!NOTE]
1616
>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).
1717
18-
## Runbook permissions for a Hybrid Runbook Worker
18+
## Plan runbook job behavior
1919

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).
2121

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).
2323

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
2525

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

2836
```powershell
2937
$Cred = Get-AutomationPSCredential -Name "MyCredential"
@@ -34,26 +42,7 @@ Restart-Computer -ComputerName $Computer -Credential $Cred
3442

3543
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).
3644

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-
### <a name="managed-identities-for-azure-resources"></a>Managed Identities for Azure Resources
45+
## <a name="runbook-auth-managed-identities"></a>Use runbook authentication with managed identities
5746

5847
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:
5948

@@ -80,7 +69,26 @@ Follow the next steps to use a managed identity for Azure resources on a Hybrid
8069
> [!NOTE]
8170
> `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.
8271
83-
### <a name="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+
### <a name="runas-script"></a>Install Run As account certificate
8492

8593
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.
8694

@@ -165,17 +173,9 @@ To finish preparing the Run As account:
165173
5. Run the runbook, targeting the Hybrid Runbook Worker group that runs and authenticates runbooks using the Run As account.
166174
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.
167175

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
177177

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

180180
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.
181181

@@ -188,14 +188,14 @@ Start-AzAutomationRunbook –AutomationAccountName "MyAutomationAccount" –Name
188188
> [!NOTE]
189189
> 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.
190190
191-
## Working with signed runbooks on a Windows Hybrid Runbook Worker
191+
## Work with signed runbooks on a Windows Hybrid Runbook Worker
192192

193193
You can configure a Windows Hybrid Runbook Worker to run only signed runbooks.
194194

195195
> [!IMPORTANT]
196196
> 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.
197197
198-
### Create Signing Certificate
198+
### Create signing certificate
199199

200200
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.
201201

@@ -248,7 +248,7 @@ Set-AuthenticodeSignature .\TestRunbook.ps1 -Certificate $SigningCert
248248

249249
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).
250250

251-
## Working with signed runbooks on a Linux Hybrid Runbook Worker
251+
## Work with signed runbooks on a Linux Hybrid Runbook Worker
252252

253253
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.
254254

@@ -307,7 +307,6 @@ You can now upload the signed runbook to Azure Automation and execute it like a
307307

308308
## Next steps
309309

310-
* To learn more about the methods for starting a runbook, see [Starting a Runbook in Azure Automation](automation-starting-a-runbook.md).
311310
* 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).
312311
* If your runbooks aren't completing successfully, review the troubleshooting guide for [runbook execution failures](troubleshoot/hybrid-runbook-worker.md#runbook-execution-fails).
313312
* 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

Comments
 (0)