Azure ARC

 

1.0 Run Command

az resource list / Get-AzResource
 
[
  {
    "id": "/subscriptions/c1c4e632-be8d-41be-a657-9259ab75e6fc/resourceGroups/ResGroup/providers/Microsoft.HybridCompute/machines/computer1",
    "identity": {
      "principalId": "de6bf5ae-ab4f-42e6-b978-1147e2ed9dcb",
      "tenantId": "dcd3a98d-d0fd-49ea-bcab-405491ce156d",
      "type": "SystemAssigned",
    },
    "location": "francecentral",
    "name": "computer1",
    "provisioningState": "Succeeded",
    "resourceGroup": "ResGroup",
    "type": "Microsoft.HybridCompute/machines"
  }
]
 
New-AzConnectedMachineRunCommand `
	-ResourceGroupName "ResGroup" `
	-MachineName "vmName01" `
	-RunCommandName "test" `
	-Location "francecentral" `
	-SourceScript "hostname;whoami"
 
InstanceViewExecutionState        : Succeeded
InstanceViewOutput                : computer1
                                    nt authority\system
InstanceViewStartTime             : 19.02.2026 10:52:46
Location                          : francecentral
Name                              : test
ProvisioningState                 : Succeeded
ResourceGroupName                 : ResGroup
SourceScript                      : hostname;whoami

SSH Extension

Permissions

Owner or Contributor permissions are needed

az CLI

Installation

Client Installation
az extension add --name ssh   
Server Installation
az connectedmachine extension create --name WindowsOpenSSH --publisher Microsoft.Azure.OpenSSH --type WindowsOpenSSH --type-handler-version 3.0.1.0 --machine-name <server-name> --resource-group <resource-group>   

Connect

az ssh arc --resource-group <resource-group> --name <server-name> --local-user <username> 

PowerShell

Hints

RDP is supported also, use --rdp flag (not supported in cloud shell) To SSH with a previously created backdoor user, some changes in the SSH config are required:

Get-Content 'C:\ProgramData\ssh\sshd_config
Add-Content -Path 'C:\ProgramData\ssh\sshd_config' -Value 'PasswordAuthentication yes'
Add-Content -Path 'C:\ProgramData\ssh\sshd_config' -Value 'PermitRootLogin yes
Add-Content -Path 'C:\ProgramData\ssh\sshd_config' -Value 'AllowUsers user';Restart-Service sshd
New-AzConnectedMachineExtension `
	-MachineName "vmName01" `
	-ResourceGroupName "ResourceGroupName" `
	-Name "WindowsOpenSSH" `
	-Publisher "Microsoft.Azure.OpenSSH" `
	-Location "francecentral" `
	-ExtensionType "WindowsOpenSSH"
Install-Module -Name Az.Ssh -Scope CurrentUser -Repository PSGallery
Export-AzSshConfig -ResourceGroupName <rg> -Name <server> -LocalUser <user> -ConfigFilePath C:\temp\ssh_config