Skip to content

Commit d1d11e3

Browse files
authored
Merge pull request #233894 from SnehaSudhirG/10Apr-HRWDocUpdate
added example for bicep, ARM, CLI and PS
2 parents f2bfce2 + 2218d1f commit d1d11e3

File tree

4 files changed

+170
-3
lines changed

4 files changed

+170
-3
lines changed

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

Lines changed: 87 additions & 2 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
7-
ms.date: 04/05/2023
7+
ms.date: 04/10/2023
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
---
@@ -295,7 +295,17 @@ New-AzConnectedMachineExtension -ResourceGroupName <VMResourceGroupName> -Locati
295295

296296
#### [Bicep template](#tab/bicep-template)
297297

298-
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)
298+
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).
299+
300+
Follow the steps mentioned below as an example:
301+
302+
1. Create a Hybrid Worker Group.
303+
1. Create either an Azure VM or Arc-enabled server. Alternatively, you can also use an existing Azure VM or Arc-enabled server.
304+
1. Connect the Azure VM or Arc-enabled server to the above created Hybrid Worker Group.
305+
1. Generate a new GUID and pass it as the name of the Hybrid Worker.
306+
1. Enable System-assigned managed identity on the VM.
307+
1. Install Hybrid Worker Extension on the VM.
308+
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.
299309

300310
```Bicep
301311
param automationAccount string
@@ -524,6 +534,17 @@ output output1 string = automationAccount_resource.properties.automationHybridSe
524534

525535
You can use an Azure Resource Manager (ARM) template to create a new Azure Windows VM and connect it to an existing Automation account and Hybrid Worker Group. To learn more about ARM templates, see [What are ARM templates?](../azure-resource-manager/templates/overview.md)
526536

537+
Follow the steps mentioned below as an example:
538+
539+
1. Create a Hybrid Worker Group.
540+
1. Create either an Azure VM or Arc-enabled server. Alternatively, you can also use an existing Azure VM or Arc-enabled server.
541+
1. Connect the Azure VM or Arc-enabled server to the above created Hybrid Worker Group.
542+
1. Generate a new GUID and pass it as the name of the Hybrid Worker.
543+
1. Enable System-assigned managed identity on the VM.
544+
1. Install Hybrid Worker Extension on the VM.
545+
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.
546+
547+
527548
**Review the template**
528549

529550
```json
@@ -953,6 +974,28 @@ To install and use Hybrid Worker extension using REST API, follow these steps. T
953974
954975
#### [Azure CLI](#tab/cli)
955976
977+
You can use Azure CLI 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. Learn more about [Azure CLI](https://learn.microsoft.com/cli/azure/what-is-azure-cli).
978+
979+
Follow the steps mentioned below as an example:
980+
981+
1. Create a Hybrid Worker Group.
982+
```azurecli-interactive
983+
az automation hrwg create --automation-account-name accountName --resource-group groupName --name hybridrunbookworkergroupName
984+
```
985+
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 `hybridRunbookWorkerGroupName`. To fetch `vmResourceId`, go to the **Properties** tab of the VM on Azure portal.
986+
987+
```azurecli-interactive
988+
az automation hrwg hrw create --automation-account-name accountName --resource-group groupName --hybrid-runbook-worker-group-name hybridRunbookWorkerGroupName --hybrid-runbook-worker-id
989+
```
990+
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.
991+
1. Install Hybrid Worker Extension on the VM
992+
993+
```azurecli-interactive
994+
az vm extension set --name HybridWorkerExtension --publisher Microsoft.Azure.Automation.HybridWorker --version 1.1 --vm-name <vmname> -g <resourceGroupName> \
995+
--settings '{"AutomationAccountURL" = "<registration-url>";}' --enable-auto-upgrade true
996+
```
997+
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.
998+
956999
**Manage Hybrid Worker Extension**
9571000

9581001
- To create, delete, and manage extension-based Hybrid Runbook Worker groups, see [az automation hrwg | Microsoft Docs](/cli/azure/automation/hrwg)
@@ -963,6 +1006,48 @@ After creating new Hybrid Runbook Worker, you must install the extension on the
9631006

9641007
#### [PowerShell](#tab/ps)
9651008

1009+
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.
1010+
1011+
Follow the steps mentioned below as an example:
1012+
1013+
1. Create a Hybrid Worker Group.
1014+
1015+
```powershell-interactive
1016+
New-AzAutomationHybridRunbookWorkerGroup -AutomationAccountName "Contoso17" -Name "RunbookWorkerGroupName" -ResourceGroupName "ResourceGroup01"
1017+
```
1018+
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 `hybridRunbookWorkerGroupName`. To fetch `vmResourceId`, go to the **Properties** tab of the VM on Azure portal.
1019+
1020+
```azurepowershell
1021+
New-AzAutomationHybridRunbookWorker -AutomationAccountName "Contoso17" -Name "RunbookWorkerName" -HybridRunbookWorkerGroupName "RunbookWorkerGroupName" -VmResourceId "VmResourceId" -ResourceGroupName "ResourceGroup01"
1022+
```
1023+
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.
1024+
1025+
1. Install Hybrid Worker Extension on the VM.
1026+
1027+
**Hybrid Worker extension settings**
1028+
1029+
```powershell-interactive
1030+
$settings = @{
1031+
"AutomationAccountURL" = "<registrationurl>";
1032+
};
1033+
```
1034+
1035+
**Azure VMs**
1036+
1037+
```powershell
1038+
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
1039+
```
1040+
**Azure Arc-enabled VMs**
1041+
1042+
```powershell
1043+
New-AzConnectedMachineExtension -ResourceGroupName <VMResourceGroupName> -Location <VMLocation> -MachineName <VMName> -Name "HybridWorkerExtension" -Publisher "Microsoft.Azure.Automation.HybridWorker" -ExtensionType HybridWorkerForWindows -TypeHandlerVersion 1.1 -Setting $settings -NoWait -EnableAutomaticUpgrade
1044+
```
1045+
1046+
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.
1047+
1048+
1049+
**Manage Hybrid Worker Extension**
1050+
9661051
You can use the following PowerShell cmdlets to manage Hybrid Runbook Worker and Hybrid Runbook Worker groups:
9671052

9681053
| PowerShell cmdlet | Description |
Loading
Loading

articles/automation/migrate-existing-agent-based-hybrid-worker-to-extension-based-workers.md

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Migrate an existing agent-based hybrid workers to extension-based-workers
33
description: This article provides information on how to migrate an existing agent-based hybrid worker to extension based workers.
44
services: automation
55
ms.subservice: process-automation
6-
ms.date: 04/05/2023
6+
ms.date: 04/11/2023
77
ms.custom: devx-track-azurecli, devx-track-bicep
88
ms.topic: how-to
99
#Customer intent: As a developer, I want to learn about extension so that I can efficiently migrate agent based hybrid workers to extension based workers.
@@ -116,6 +116,16 @@ For at-scale migration of multiple Agent based Hybrid Workers, you can also use
116116

117117
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).
118118

119+
Follow the steps mentioned below as an example:
120+
121+
1. Create a Hybrid Worker Group.
122+
1. Create either an Azure VM or Arc-enabled server. Alternatively, you can also use an existing Azure VM or Arc-enabled server.
123+
1. Connect the Azure VM or Arc-enabled server to the above created Hybrid Worker Group.
124+
1. Generate a new GUID and pass it as the name of the Hybrid Worker.
125+
1. Enable System-assigned managed identity on the VM.
126+
1. Install Hybrid Worker Extension on the VM.
127+
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.
128+
119129
```Bicep
120130
param automationAccount string
121131
param automationAccountLocation string
@@ -343,6 +353,16 @@ output output1 string = automationAccount_resource.properties.automationHybridSe
343353

344354
You can use an Azure Resource Manager (ARM) template to create a new Azure Windows VM and connect it to an existing Automation account and Hybrid Worker Group. To learn more about ARM templates, see [What are ARM templates?](../azure-resource-manager/templates/overview.md)
345355

356+
Follow the steps mentioned below as an example:
357+
358+
1. Create a Hybrid Worker Group.
359+
1. Create either an Azure VM or Arc-enabled server. Alternatively, you can also use an existing Azure VM or Arc-enabled server.
360+
1. Connect the Azure VM or Arc-enabled server to the above created Hybrid Worker Group.
361+
1. Generate a new GUID and pass it as the name of the Hybrid Worker.
362+
1. Enable System-assigned managed identity on the VM.
363+
1. Install Hybrid Worker Extension on the VM.
364+
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.
365+
346366
**Review the template**
347367

348368
```json
@@ -772,6 +792,28 @@ To install and use Hybrid Worker extension using REST API, follow these steps. T
772792
773793
#### [Azure CLI](#tab/cli)
774794
795+
You can use Azure CLI 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. Learn more about [Azure CLI](https://learn.microsoft.com/cli/azure/what-is-azure-cli).
796+
797+
Follow the steps mentioned below as an example:
798+
799+
1. Create a Hybrid Worker Group.
800+
```azurecli-interactive
801+
az automation hrwg create --automation-account-name accountName --resource-group groupName --name hybridrunbookworkergroupName
802+
```
803+
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 `hybridRunbookWorkerGroupName`. To fetch `vmResourceId`, go to the **Properties** tab of the VM on Azure portal.
804+
805+
```azurecli-interactive
806+
az automation hrwg hrw create --automation-account-name accountName --resource-group groupName --hybrid-runbook-worker-group-name hybridRunbookWorkerGroupName --hybrid-runbook-worker-id
807+
```
808+
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.
809+
1. Install Hybrid Worker Extension on the VM
810+
811+
```azurecli-interactive
812+
az vm extension set --name HybridWorkerExtension --publisher Microsoft.Azure.Automation.HybridWorker --version 1.1 --vm-name <vmname> -g <resourceGroupName> \
813+
--settings '{"AutomationAccountURL" = "<registration-url>";}' --enable-auto-upgrade true
814+
```
815+
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.
816+
775817
**Manage Hybrid Worker Extension**
776818

777819
- To create, delete, and manage extension-based Hybrid Runbook Worker groups, see [az automation hrwg | Microsoft Docs](/cli/azure/automation/hrwg?view=azure-cli-latest)
@@ -782,6 +824,46 @@ After creating new Hybrid Runbook Worker, you must install the extension on the
782824

783825
#### [PowerShell](#tab/ps)
784826

827+
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.
828+
829+
Follow the steps mentioned below as an example:
830+
831+
1. Create a Hybrid Worker Group.
832+
833+
```powershell-interactive
834+
New-AzAutomationHybridRunbookWorkerGroup -AutomationAccountName "Contoso17" -Name "RunbookWorkerGroupName" -ResourceGroupName "ResourceGroup01"
835+
```
836+
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 `hybridRunbookWorkerGroupName`. To fetch `vmResourceId`, go to the **Properties** tab of the VM on Azure portal.
837+
838+
```azurepowershell
839+
New-AzAutomationHybridRunbookWorker -AutomationAccountName "Contoso17" -Name "RunbookWorkerName" -HybridRunbookWorkerGroupName "RunbookWorkerGroupName" -VmResourceId "VmResourceId" -ResourceGroupName "ResourceGroup01"
840+
```
841+
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.
842+
1. Install Hybrid Worker Extension on the VM.
843+
844+
**Hybrid Worker extension settings**
845+
846+
```powershell-interactive
847+
$settings = @{
848+
"AutomationAccountURL" = "<registrationurl>";
849+
};
850+
```
851+
852+
**Azure VMs**
853+
854+
```powershell
855+
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
856+
```
857+
**Azure Arc-enabled VMs**
858+
859+
```powershell
860+
New-AzConnectedMachineExtension -ResourceGroupName <VMResourceGroupName> -Location <VMLocation> -MachineName <VMName> -Name "HybridWorkerExtension" -Publisher "Microsoft.Azure.Automation.HybridWorker" -ExtensionType HybridWorkerForWindows -TypeHandlerVersion 1.1 -Setting $settings -NoWait -EnableAutomaticUpgrade
861+
```
862+
863+
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.
864+
865+
**Manage Hybrid Worker Extension**
866+
785867
You can use the following PowerShell cmdlets to manage Hybrid Runbook Worker and Hybrid Runbook Worker groups:
786868

787869
| PowerShell cmdlet | Description |

0 commit comments

Comments
 (0)