Skip to content

Commit ef2bb08

Browse files
committed
Inputs incorporated
1 parent 2a96c64 commit ef2bb08

File tree

1 file changed

+116
-83
lines changed

1 file changed

+116
-83
lines changed

articles/automation/extension-based-hybrid-runbook-worker-install.md

Lines changed: 116 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: This article provides information about deploying the extension-bas
44
services: automation
55
ms.subservice: process-automation
66
ms.custom: devx-track-azurepowershell, devx-track-azurecli, devx-track-bicep, linux-related-content
7-
ms.date: 04/07/2025
7+
ms.date: 04/21/2025
88
ms.topic: how-to
99
#Customer intent: As a developer, I want to learn about extension so that I can efficiently deploy Hybrid Runbook Workers.
1010
ms.service: azure-automation
@@ -105,12 +105,34 @@ If you use a proxy server for communication between Azure Automation and machine
105105
1. Install the Hybrid Worker Extension on the VM by running the following PowerShell cmdlet (Required module: Az.Compute). Use the `properties.automationHybridServiceUrl` provided by the above API call
106106

107107

108-
**Proxy server settings**
108+
## Automation Account Hybrid Service URL
109+
110+
You must retrieve and use the AutomationHybridServiceURL to deploy the Hybrid Worker extension to the VM/Arc machine.
111+
112+
> [!NOTE]
113+
> The necessary URL is the automationHybridServiceUrl, NOT the RegistrationUrl.
114+
115+
There are multiple ways to retrieve the value for AutomationHybridServiceUrl:
116+
117+
- Copy it from the **Azure portal**, **Automation Account**, **Properties**, **Automation hybrid service URL**.
118+
119+
Or
120+
121+
- Copy it from the **Azure portal**, **Automation Account**, **Overview**, **JSON** view. </br> Select the latest API version, otherwise AutomationHybridServiceUrl might not be displayed.
122+
123+
Or
124+
- The below REST API call:
125+
126+
```rest
127+
GET https://westcentralus.management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}?api-version=2021-06-22
128+
129+
```
130+
109131
# [Windows](#tab/windows)
110132

111133
```azurepowershell-interactive
112134
$settings = @{
113-
"AutomationAccountURL" = "<registrationurl>";
135+
"AutomationAccountURL" = "<automationHybridServiceUrl>";
114136
"ProxySettings" = @{
115137
"ProxyServer" = "<ipaddress>:<port>";
116138
"UserName"="test";
@@ -139,7 +161,7 @@ $protectedsettings = @{
139161
"Proxy_URL"="http://username:password@<IP Address>"
140162
};
141163
$settings = @{
142-
"AutomationAccountURL" = "<registration-url>";
164+
"AutomationAccountURL" = "<automationHybridServiceUrl>";
143165
};
144166
```
145167
**Azure VMs**
@@ -153,7 +175,6 @@ Set-AzVMExtension -ResourceGroupName <VMResourceGroupName> -Location <VMLocation
153175
```powershell
154176
New-AzConnectedMachineExtension -ResourceGroupName <VMResourceGroupName> -Location <VMLocation> -MachineName <VMName> -Name "HybridWorkerExtension" -Publisher "Microsoft.Azure.Automation.HybridWorker" -ExtensionType HybridWorkerForLinux -TypeHandlerVersion 1.1 -Setting $settings -ProtectedSetting $protectedsettings -NoWait -EnableAutomaticUpgrade
155177
```
156-
157178
---
158179

159180
### Firewall use
@@ -313,6 +334,95 @@ New-AzConnectedMachineExtension -ResourceGroupName <VMResourceGroupName> -Locati
313334

314335
## Manage Hybrid Worker extension using Bicep & ARM templates, REST API, Azure CLI, and PowerShell
315336

337+
#### [PowerShell](#tab/ps)
338+
339+
You can use PowerShell cmdlets to create a new Hybrid Worker group, create a new Azure VM, add it to an existing Hybrid Worker Group and install the Hybrid Worker extension.
340+
341+
Follow the steps mentioned below as an example:
342+
343+
1. Create a Hybrid Worker Group.
344+
345+
```powershell-interactive
346+
New-AzAutomationHybridRunbookWorkerGroup -AutomationAccountName "Contoso17" -Name "RunbookWorkerGroupName" -ResourceGroupName "ResourceGroup01"
347+
```
348+
1. Create an Azure VM or Arc-enabled server and add it to the above created Hybrid Worker Group. Use the below command to add an existing Azure VM or Arc-enabled Server to the Hybrid Worker Group. Generate a new GUID and pass it as the name of the Hybrid Worker. To fetch `vmResourceId`, go to the **Properties** tab of the VM on Azure portal.
349+
350+
```azurepowershell
351+
#To fetch vmResourceId, go to the Properties tab of the VM on Azure portal.
352+
$hwVM = "VmResourceId"
353+
354+
# Generate a new GUID and pass it as the name of the Hybrid Worker
355+
$hwguid = New-Guid
356+
357+
# Create the Hybrid Worker
358+
New-AzAutomationHybridRunbookWorker `
359+
-Name $hwguid `
360+
-VmResourceId $hwVM `
361+
-HybridRunbookWorkerGroupName "RunbookWorkerGroupName" `
362+
-AutomationAccountName "Contoso17" `
363+
-ResourceGroupName "AutomationAccountResourceGroup01"
364+
```
365+
1. Follow the steps [here](../active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm.md#enable-system-assigned-managed-identity-on-an-existing-vm) to enable the System-assigned managed identity on the VM.
366+
367+
1. Install Hybrid Worker Extension on the VM and Hybrid Worker extension settings for [proxy server use](#proxy-server-use).
368+
369+
**Hybrid Worker extension settings**
370+
371+
```powershell-interactive
372+
$settings = @{
373+
"AutomationAccountURL" = "<automationHybridServiceUrl>";
374+
};
375+
```
376+
377+
**Azure VMs**
378+
379+
```powershell
380+
Set-AzVMExtension -ResourceGroupName <VMResourceGroupName> -Location <VMLocation> -VMName <VMName> -Name "HybridWorkerExtension" -Publisher "Microsoft.Azure.Automation.HybridWorker" -ExtensionType HybridWorkerForWindows -TypeHandlerVersion 1.1 -Settings $settings -EnableAutomaticUpgrade $true/$false
381+
```
382+
**Azure Arc-enabled VMs**
383+
384+
```powershell
385+
New-AzConnectedMachineExtension -ResourceGroupName <VMResourceGroupName> -Location <VMLocation> -MachineName <VMName> -Name "HybridWorkerExtension" -Publisher "Microsoft.Azure.Automation.HybridWorker" -ExtensionType HybridWorkerForWindows -TypeHandlerVersion 1.1 -Setting $settings -NoWait -EnableAutomaticUpgrade
386+
```
387+
388+
1. To confirm if the extension has been successfully installed on the VM, In **Azure portal**, go to the VM > **Extensions** tab and check the status of Hybrid Worker extension installed on the VM.
389+
390+
391+
**Manage Hybrid Worker Extension**
392+
393+
You can use the following PowerShell cmdlets to manage Hybrid Runbook Worker and Hybrid Runbook Worker groups:
394+
395+
| PowerShell cmdlet | Description |
396+
| ----- | ----------- |
397+
|[`Get-AzAutomationHybridRunbookWorkerGroup`](/powershell/module/az.automation/get-azautomationhybridrunbookworkergroup) | Gets Hybrid Runbook Worker group|
398+
|[`Remove-AzAutomationHybridRunbookWorkerGroup`](/powershell/module/az.automation/remove-azautomationhybridrunbookworkergroup) | Removes Hybrid Runbook Worker group|
399+
|[`Set-AzAutomationHybridRunbookWorkerGroup`](/powershell/module/az.automation/set-azautomationhybridrunbookworkergroup) | Updates Hybrid Worker group with Hybrid Worker credentials|
400+
|[`New-AzAutomationHybridRunbookWorkerGroup`](/powershell/module/az.automation/new-azautomationhybridrunbookworkergroup) | Creates new Hybrid Runbook Worker group|
401+
|[`Get-AzAutomationHybridRunbookWorker`](/powershell/module/az.automation/get-azautomationhybridrunbookworker) | Gets Hybrid Runbook Worker|
402+
|[`Move-AzAutomationHybridRunbookWorker`](/powershell/module/az.automation/move-azautomationhybridrunbookworker) | Moves Hybrid Worker from one group to other|
403+
|[`New-AzAutomationHybridRunbookWorker`](/powershell/module/az.automation/new-azautomationhybridrunbookworker) | Creates new Hybrid Runbook Worker|
404+
|[`Remove-AzAutomationHybridRunbookWorker`](/powershell/module/az.automation/remove-azautomationhybridrunbookworker)| Removes Hybrid Runbook Worker|
405+
406+
After creating new Hybrid Runbook Worker, you must install the extension on the Hybrid Worker.
407+
408+
**Hybrid Worker extension settings**
409+
410+
```powershell-interactive
411+
$settings = @{
412+
"AutomationAccountURL" = "<automationHybridServiceUrl>";
413+
};
414+
```
415+
**Azure VMs**
416+
417+
```powershell
418+
Set-AzVMExtension -ResourceGroupName <VMResourceGroupName> -Location <VMLocation> -VMName <VMName> -Name "HybridWorkerExtension" -Publisher "Microsoft.Azure.Automation.HybridWorker" -ExtensionType HybridWorkerForWindows -TypeHandlerVersion 1.1 -Settings $settings -EnableAutomaticUpgrade $true/$false
419+
```
420+
**Azure Arc-enabled VMs**
421+
422+
```powershell
423+
New-AzConnectedMachineExtension -ResourceGroupName <VMResourceGroupName> -Location <VMLocation> -MachineName <VMName> -Name "HybridWorkerExtension" -Publisher "Microsoft.Azure.Automation.HybridWorker" -ExtensionType HybridWorkerForWindows -TypeHandlerVersion 1.1 -Setting $settings -NoWait -EnableAutomaticUpgrade
424+
```
425+
316426
#### [Bicep template](#tab/bicep-template)
317427

318428
You can use the Bicep template to create a new Hybrid Worker group, create a new Azure Windows VM and add it to an existing Hybrid Worker Group. Learn more about [Bicep](../azure-resource-manager/bicep/overview.md).
@@ -1012,7 +1122,7 @@ Follow the steps mentioned below as an example:
10121122

10131123
```azurecli-interactive
10141124
az vm extension set --name HybridWorkerExtension --publisher Microsoft.Azure.Automation.HybridWorker --version 1.1 --vm-name <vmname> -g <resourceGroupName> \
1015-
--settings '{"AutomationAccountURL" = "<registration-url>";}' --enable-auto-upgrade true
1125+
--settings '{"AutomationAccountURL" = "<automationHybridServiceUrl>";}' --enable-auto-upgrade true
10161126
```
10171127
1. To confirm if the extension has been successfully installed on the VM, in **Azure portal**, go to the VM > **Extensions** tab and check the status of the Hybrid Worker extension installed on the VM.
10181128

@@ -1023,83 +1133,6 @@ Follow the steps mentioned below as an example:
10231133

10241134
After creating new Hybrid Runbook Worker, you must install the extension on the Hybrid Worker using [az vm extension set](/cli/azure/vm/extension#az-vm-extension-set).
10251135

1026-
1027-
#### [PowerShell](#tab/ps)
1028-
1029-
You can use PowerShell cmdlets to create a new Hybrid Worker group, create a new Azure VM, add it to an existing Hybrid Worker Group and install the Hybrid Worker extension.
1030-
1031-
Follow the steps mentioned below as an example:
1032-
1033-
1. Create a Hybrid Worker Group.
1034-
1035-
```powershell-interactive
1036-
New-AzAutomationHybridRunbookWorkerGroup -AutomationAccountName "Contoso17" -Name "RunbookWorkerGroupName" -ResourceGroupName "ResourceGroup01"
1037-
```
1038-
1. Create an Azure VM or Arc-enabled server and add it to the above created Hybrid Worker Group. Use the below command to add an existing Azure VM or Arc-enabled Server to the Hybrid Worker Group. Generate a new GUID and pass it as the name of the Hybrid Worker. To fetch `vmResourceId`, go to the **Properties** tab of the VM on Azure portal.
1039-
1040-
```azurepowershell
1041-
New-AzAutomationHybridRunbookWorker -AutomationAccountName "Contoso17" -Name "RunbookWorkerName" -HybridRunbookWorkerGroupName "RunbookWorkerGroupName" -VmResourceId "VmResourceId" -ResourceGroupName "ResourceGroup01"
1042-
```
1043-
1. Follow the steps [here](../active-directory/managed-identities-azure-resources/qs-configure-portal-windows-vm.md#enable-system-assigned-managed-identity-on-an-existing-vm) to enable the System-assigned managed identity on the VM.
1044-
1045-
1. Install Hybrid Worker Extension on the VM.
1046-
1047-
**Hybrid Worker extension settings**
1048-
1049-
```powershell-interactive
1050-
$settings = @{
1051-
"AutomationAccountURL" = "<registrationurl>";
1052-
};
1053-
```
1054-
1055-
**Azure VMs**
1056-
1057-
```powershell
1058-
Set-AzVMExtension -ResourceGroupName <VMResourceGroupName> -Location <VMLocation> -VMName <VMName> -Name "HybridWorkerExtension" -Publisher "Microsoft.Azure.Automation.HybridWorker" -ExtensionType HybridWorkerForWindows -TypeHandlerVersion 1.1 -Settings $settings -EnableAutomaticUpgrade $true/$false
1059-
```
1060-
**Azure Arc-enabled VMs**
1061-
1062-
```powershell
1063-
New-AzConnectedMachineExtension -ResourceGroupName <VMResourceGroupName> -Location <VMLocation> -MachineName <VMName> -Name "HybridWorkerExtension" -Publisher "Microsoft.Azure.Automation.HybridWorker" -ExtensionType HybridWorkerForWindows -TypeHandlerVersion 1.1 -Setting $settings -NoWait -EnableAutomaticUpgrade
1064-
```
1065-
1066-
1. To confirm if the extension has been successfully installed on the VM, In **Azure portal**, go to the VM > **Extensions** tab and check the status of Hybrid Worker extension installed on the VM.
1067-
1068-
1069-
**Manage Hybrid Worker Extension**
1070-
1071-
You can use the following PowerShell cmdlets to manage Hybrid Runbook Worker and Hybrid Runbook Worker groups:
1072-
1073-
| PowerShell cmdlet | Description |
1074-
| ----- | ----------- |
1075-
|[`Get-AzAutomationHybridRunbookWorkerGroup`](/powershell/module/az.automation/get-azautomationhybridrunbookworkergroup) | Gets Hybrid Runbook Worker group|
1076-
|[`Remove-AzAutomationHybridRunbookWorkerGroup`](/powershell/module/az.automation/remove-azautomationhybridrunbookworkergroup) | Removes Hybrid Runbook Worker group|
1077-
|[`Set-AzAutomationHybridRunbookWorkerGroup`](/powershell/module/az.automation/set-azautomationhybridrunbookworkergroup) | Updates Hybrid Worker group with Hybrid Worker credentials|
1078-
|[`New-AzAutomationHybridRunbookWorkerGroup`](/powershell/module/az.automation/new-azautomationhybridrunbookworkergroup) | Creates new Hybrid Runbook Worker group|
1079-
|[`Get-AzAutomationHybridRunbookWorker`](/powershell/module/az.automation/get-azautomationhybridrunbookworker) | Gets Hybrid Runbook Worker|
1080-
|[`Move-AzAutomationHybridRunbookWorker`](/powershell/module/az.automation/move-azautomationhybridrunbookworker) | Moves Hybrid Worker from one group to other|
1081-
|[`New-AzAutomationHybridRunbookWorker`](/powershell/module/az.automation/new-azautomationhybridrunbookworker) | Creates new Hybrid Runbook Worker|
1082-
|[`Remove-AzAutomationHybridRunbookWorker`](/powershell/module/az.automation/remove-azautomationhybridrunbookworker)| Removes Hybrid Runbook Worker|
1083-
1084-
After creating new Hybrid Runbook Worker, you must install the extension on the Hybrid Worker.
1085-
1086-
**Hybrid Worker extension settings**
1087-
1088-
```powershell-interactive
1089-
$settings = @{
1090-
"AutomationAccountURL" = "<registrationurl>";
1091-
};
1092-
```
1093-
**Azure VMs**
1094-
1095-
```powershell
1096-
Set-AzVMExtension -ResourceGroupName <VMResourceGroupName> -Location <VMLocation> -VMName <VMName> -Name "HybridWorkerExtension" -Publisher "Microsoft.Azure.Automation.HybridWorker" -ExtensionType HybridWorkerForWindows -TypeHandlerVersion 1.1 -Settings $settings -EnableAutomaticUpgrade $true/$false
1097-
```
1098-
**Azure Arc-enabled VMs**
1099-
1100-
```powershell
1101-
New-AzConnectedMachineExtension -ResourceGroupName <VMResourceGroupName> -Location <VMLocation> -MachineName <VMName> -Name "HybridWorkerExtension" -Publisher "Microsoft.Azure.Automation.HybridWorker" -ExtensionType HybridWorkerForWindows -TypeHandlerVersion 1.1 -Setting $settings -NoWait -EnableAutomaticUpgrade
1102-
```
11031136
---
11041137

11051138
## Manage Role permissions for Hybrid Worker Groups and Hybrid Workers

0 commit comments

Comments
 (0)