Azure Arc for servers: the complete setup guide, and why it changes how you run everything outside Azure
One agent turns any Windows or Linux server, in your datacentre, a branch office or another cloud, into an Azure resource you can patch, protect, monitor and govern from one place. How it works, how to plan it, every onboarding method, what to switch on, day-two operations and troubleshooting, plus a planner that builds your firewall list and onboarding script.
On this page
- What Arc is, and what it isn't
- How it works
- Plan before you onboard
- The network in detail
- Plan your rollout with the planner
- Before you start: prerequisites
- Step by step: your first server
- Onboarding at scale
- After onboarding: switch things on
- Lock the agent down
- Day-two operations
- What it costs
- Troubleshooting
- FAQ
Most estates don't live in one place. There's a datacentre, a couple of branch offices, some workloads in another cloud, and usually one server under a desk that nobody quite owns. Each one tends to come with its own patching, its own monitoring and its own blind spots.
Azure Arc-enabled servers fixes that without moving anything. You install one agent and the server becomes an Azure resource. It gets a resource ID, sits in a resource group, takes tags, and can be managed by the same Azure tools you already use for your Azure VMs.
This guide goes end to end: how Arc works under the hood, how to plan a rollout, the network options, every onboarding method, what to switch on afterwards, how to lock it down, how to run it day to day, and how to fix it when it breaks. Everything comes from Microsoft's own documentation, linked at the end.
What Arc is, and what it isn't
Microsoft's definition: Arc-enabled servers lets you manage Windows and Linux physical servers and virtual machines hosted outside of Azure, on your corporate network or with another cloud provider.
- It doesn't migrate anything. The server stays where it is and keeps running its workload. Arc adds a management connection.
- It's not for Azure VMs. The agent won't install on an Azure VM, and the installer rolls back if it detects one.
- An Arc outage doesn't stop your servers. Microsoft is explicit that an outage only affects management through Arc, not the workload itself.
- There's no limit on the number of Arc-enabled servers or extensions in a resource group or subscription.
- Your data stays in region. By default, customer data stays in the region you register the server in. The metadata Arc collects is things like the OS name and version, computer name, FQDN and agent version.
How it works
The agent
The Azure Connected Machine agent is a handful of services working side by side:
| Service (Windows name) | What it does | Runs as |
|---|---|---|
Hybrid Instance Metadata Service (himds) | Holds the connection to Azure, syncs metadata and hosts the local endpoint that hands out managed identity tokens | Unprivileged virtual account (NT SERVICE\himds), or the himds user on Linux |
Machine configuration (GCArcService) | Audits and enforces machine configuration policies | Local System, or root on Linux |
Extension manager (ExtensionService) | Installs, updates and removes VM extensions | Local System, or root on Linux |
| Azure Arc Proxy | Routes the agent's traffic. Used with Azure Arc gateway | Network Service, or the arcproxy user on Linux |
On Windows it installs to %ProgramFiles%\AzureConnectedMachineAgent, with configuration, logs and identity files in %ProgramData%\AzureConnectedMachineAgent. On Linux it lives under /opt/azcmagent/ and /var/opt/azcmagent/.
The connection
Every connection the agent makes is outbound HTTPS on TCP 443. There are no inbound ports to open and no VPN to build. The agent keeps a persistent connection open for notifications and sends a heartbeat every five minutes.
| Status | What it means |
|---|---|
| Connected | Heartbeats are arriving. Everything works. |
| Disconnected | No heartbeat for 15 to 30 minutes. The server is off, the agent isn't running, or the network path is blocked. |
| Expired | Disconnected for 45 days. It can't be managed through Arc until an admin disconnects and reconnects it. |
The server's identity credential is valid for up to 90 days and renews every 45, which is why a long disconnection matters. If a server is disconnected, its machine configuration assignments are kept locally for 14 days and then deleted.
The control model
The only way to make the agent do anything, such as install an extension or run a command, is through the server's resource in Azure. So Azure RBAC on that resource is your access control, and Azure activity logs are your audit trail. On top of that, local settings on the server take precedence over anything set in the cloud, which we'll use later to lock it down.
Plan before you onboard
Organise your resources
An Arc server is a normal Azure resource, so the structure you choose now drives RBAC, Azure Policy and cost reporting later. A few patterns that work well:
- Resource groups per site or environment, such as
rg-arc-london-prod. That's your natural boundary for who can manage what. - Tags at connect time, such as
Datacenter,EnvironmentandOwner.azcmagent connecttakes a--tagsflag, so every server arrives labelled. - The nearest region when you generate the script. Microsoft recommends the Azure region closest to the server, and it's also where that server's data is kept.
Who needs which role
| Who | Role | Scope |
|---|---|---|
| Whoever, or whatever, connects servers | Azure Connected Machine Onboarding (or Contributor) | Target resource group |
| Day-to-day server admins | Azure Connected Machine Resource Administrator | Resource group |
| Anyone using the portal's script generator | Reader, in addition | Resource group |
| Whoever creates the onboarding service principal | Owner or User Access Administrator, plus Application Administrator or Cloud Application Administrator if users can't register apps | Subscription |
| Associating servers with Private Link | Microsoft.HybridCompute/privateLinkScopes/read | The Private Link Scope |
Choose a network pattern
| Pattern | Good for | Watch out for |
|---|---|---|
| Direct internet | Simple sites with open outbound HTTPS | About a dozen endpoints to allow, including the regional Entra endpoint |
| HTTP proxy | Most enterprises | Don't break and inspect the traffic. A Log Analytics gateway isn't supported as the agent's proxy |
| Azure Arc gateway | Locked-down proxies where every URL is a change request | Cuts the list to seven endpoints. Public cloud only, no proxy bypass, avoid TLS inspection on the gateway URL |
| Private Link | Traffic over ExpressRoute or VPN | Only the Arc endpoints go private. Entra ID and Resource Manager still need a public route unless you add more private links |
The network in detail
Endpoints and service tags
The planner below builds the exact list for your options. The short version:
- Always:
login.microsoftonline.com,*.login.microsoft.com,pas.windows.net,*.his.arc.azure.com,*.guestconfiguration.azure.com, the guest notification service and*.servicebus.windows.net. - When installing:
download.microsoft.comfor Windows andpackages.microsoft.comfor Linux. - When connecting or disconnecting:
management.azure.com. - Service tags, if your firewall supports them:
AzureActiveDirectory,AzureTrafficManager,AzureResourceManager,AzureArcInfrastructure,StorageandAzureFrontDoor.Frontend. Allow the wholeAzureArcInfrastructuretag, not a regional slice.
One that catches people out: the agent normally gets tokens from a regional Entra endpoint, such as uksouth.login.microsoft.com, and only falls back to the global one. Allowing login.microsoftonline.com on its own isn't enough. Servers need TLS 1.2 or 1.3, which is on by default from Windows Server 2012 R2.
Using a proxy
Set the proxy on the agent itself rather than through environment variables. No service restart is needed:
azcmagent config set proxy.url "http://proxy.contoso.com:8080"
azcmagent config get proxy.url
azcmagent config clear proxy.urlIf some traffic should skip the proxy, for example because Entra ID is reachable directly, use proxy.bypass with one or more of AAD, ARM, AMA, Arc and ArcData:
azcmagent config set proxy.bypass "AAD,ARM"Some extensions don't inherit the agent's proxy settings, so check each extension's documentation.
Azure Arc gateway
The gateway is an Azure resource that acts as a single front door for Arc traffic. With it, servers only need seven endpoints: your gateway URL (<prefix>.gw.arc.azure.com), management.azure.com, login.microsoftonline.com plus your regional login endpoint, gbl.his.arc.azure.com, <region>.his.arc.azure.com, and the package download site for your OS.
- Up to five gateways per subscription. For servers only, one gateway handles around 2,000 servers per region.
- The onboarding script gains a
--gateway-idparameter. From agent 1.51, existing servers switch to the gateway automatically when you associate them. - Some extensions still need their own endpoints. The Azure Monitor Agent, for example, needs your Log Analytics workspace's ingestion endpoint.
Private Link
Create an Azure Arc Private Link Scope and a private endpoint, then connect servers with --private-link-scope "<scope resource ID>". Only *.his.arc.azure.com and *.guestconfiguration.azure.com go through the private endpoint. Entra ID and the notification service stay public, and management.azure.com stays public unless you also set up a Resource Manager private link.
Plan your rollout with the planner
Pick your options below. You'll get the exact firewall allow-list, an onboarding script with your values filled in, and a readiness checklist. Nothing you type leaves your browser.
Before you start: prerequisites
Supported operating systems
- Windows Server 2012, 2012 R2, 2016, 2019, 2022 and 2025, Desktop or Server Core, x64 only.
- Windows 10 and 11, but only when used like a server: always on, always connected.
- Linux, including Ubuntu 18.04 to 24.04, RHEL 7 to 10, Debian 11 to 13, SLES 12 SP5 and 15, Rocky, Alma, Oracle Linux, Azure Linux and Amazon Linux. 64-bit only.
If a version isn't on Microsoft's list, it isn't supported. Linux needs systemd, wget and openssl, plus gnupg on Debian-based systems. On Windows, if Group Policy controls the "Log on as a service" right, add NT SERVICE\himds to it.
Resource providers
az account set --subscription "<subscription>"
az provider register --namespace Microsoft.HybridCompute
az provider register --namespace Microsoft.GuestConfiguration
az provider register --namespace Microsoft.HybridConnectivity
az provider register --namespace Microsoft.AzureArcData # only for Arc-enabled SQL Server
az provider register --namespace Microsoft.Compute # for Update ManagerStep by step: your first server
- Register the resource providers above, once per subscription.
- Create the resource group, following the structure you planned.
- Open the network using the planner's list, a proxy, Arc gateway or Private Link.
- Generate the script. In the portal, go to Azure Arc > Machines > Onboard/Create > Onboard existing machines. Pick the subscription, resource group and nearest region, add tags, and download the script.
- Check the network from the server before connecting:
azcmagent check --location uksouth - Run the script as an administrator. On Windows it must be a 64-bit PowerShell session. Without a service principal it signs you in through a browser or device code.
- Confirm it worked. The server should show as Connected under Azure Arc > Machines within a few minutes, and
azcmagent showon the server should say the same.
Onboarding at scale
The service principal
For anything beyond a handful of servers, use a service principal. In the portal, go to Azure Arc > Service principals > Add, scope it to the resource group or subscription, choose a secret lifetime, and give it the Azure Connected Machine Onboarding role. Microsoft describes it as a limited identity with only the permission needed to connect machines, and it's used only during onboarding.
When you generate the script, choose Authenticate machines automatically and pick the service principal. The connect command then looks like this:
azcmagent connect `
--subscription-id "<subscription-id>" `
--resource-group "rg-arc-london-prod" `
--location "uksouth" `
--tenant-id "<tenant-id>" `
--service-principal-id "<app-id>" `
--service-principal-secret "<secret>" `
--tags "Datacenter=London,Environment=Prod"Microsoft recommends passing the secret through a configuration file rather than on the command line, so it doesn't end up in console logs. Keep the secret's lifetime short and remove it when the rollout's done.
Every way to roll it out
| Method | OS | Best for |
|---|---|---|
| Portal-generated script | Windows, Linux | One server or a handful |
| PowerShell | Windows, Linux | Scripted rollouts |
| Service principal script | Windows, Linux | Any tool that can run a script unattended |
| Group Policy | Windows | Domain-joined servers |
| Configuration Manager (scripts or task sequence) | Windows | Estates already managed by ConfigMgr |
| Ansible | Windows, Linux | Linux-heavy estates and Ansible shops |
| Multicloud connector (AWS) | Windows, Linux | EC2 instances, discovered automatically |
| Arc-enabled VMware vSphere | Windows, Linux | VMware estates, through vCenter (VMware Tools required) |
| Windows Admin Center | Windows | Servers you already manage in WAC |
| Azure Arc setup for Windows Server | Windows | Interactive setup on the server itself |
Group Policy, step by step
- Create a share that domain controllers and servers can reach. Give domain computers Change permission and domain admins Full Control.
- Download Microsoft's ArcEnabledServersGroupPolicy release from GitHub and the agent MSI from
aka.ms/AzureConnectedMachineAgent, and put both on the share. - On a domain controller, run
DeployGPO.ps1:.\DeployGPO.ps1 -DomainFQDN contoso.com -ReportServerFQDN Server.contoso.com ` -ArcRemoteShare AzureArcOnBoard -ServicePrincipalSecret $ServicePrincipalSecret ` -ServicePrincipalClientId $ServicePrincipalClientId -SubscriptionId $SubscriptionId ` -ResourceGroup $ResourceGroup -Location $Location -TenantId $TenantId - Link the new GPO, [MSFT] Azure Arc Servers (datetime), to the OU of servers you want to onboard. It runs a scheduled task on each one. Scope it carefully, because everything in scope gets onboarded.
- Once the servers show as Connected, disable the GPO, so the task doesn't run again at every reboot or policy refresh.
Things to decide during rollout
- SQL Server: servers running SQL Server have their SQL instances connected to Arc automatically. To opt out, add the tag
ArcSQLServerExtensionDeployment = Disabledwhen you connect. - Automatic agent upgrades (preview, agent 1.57+, public cloud only): add
--enable-automatic-upgradeto the connect command, or assign the built-in policy Configure Azure Arc-enabled Servers to enable automatic upgrades.
After onboarding: switch things on
This is where Arc pays off. Use Azure Policy at the resource group or management group so every new server picks everything up the moment it connects.
Update Manager
Assign the built-in policy Configure periodic checking for missing system updates on Azure Arc-enabled servers, once for Windows and once for Linux, with a remediation task. Update Manager then checks each server for missing updates every 24 hours. Add a maintenance configuration to patch on a schedule alongside your Azure VMs.
Azure Monitor
Create a data collection rule for the logs and counters you want, then assign Microsoft's built-in initiative to configure Windows or Linux Arc machines with the Azure Monitor Agent, passing the DCR's resource ID. The policy installs the agent and associates the rule on every server it covers.
Defender for Cloud
Turn on Defender for Servers for the subscription. Arc servers in it get Microsoft Defender for Endpoint, vulnerability management and threat detection, just like Azure VMs. Plan 2 also covers Update Manager and machine configuration costs for those servers.
Machine configuration
Assign machine configuration policies, such as Microsoft's security baselines, to audit settings inside every server, wherever it runs.
Windows Server Management enabled by Azure Arc
If your Windows Server licences have active Software Assurance or are subscription licences, you can unlock a set of services at no extra cost beyond networking, storage and log ingestion:
- Update Manager, Change Tracking and Inventory, and machine configuration (Windows Server 2012 and later).
- Windows Admin Center in Azure, Remote Support, Best Practices Assessment, Azure Site Recovery configuration, and discounted Azure File Sync (Windows Server 2016 and later).
- Network HUD (Windows Server 2025).
It isn't automatic. You have to attest: go to Azure Arc > Licenses > Azure Benefits - Windows Server, select the servers, choose Activate benefits, accept the terms and select Activate. The status changes to Activated within about ten minutes. Servers need agent 1.47 or later and must be Connected.
Managed identity: no more secrets in config files
Every Arc server gets a system-assigned managed identity. Grant it access to, say, a Key Vault, and apps on the server can get a token from a local endpoint at http://localhost:40342. Only members of the local Administrators or Hybrid Agent Extension Applications group on Windows, or the himds group on Linux, can request tokens. The request is a two-step challenge that proves the caller can read a protected local file:
$apiVersion = "2020-06-01"
$resource = "https://vault.azure.net"
$endpoint = "{0}?resource={1}&api-version={2}" -f $env:IDENTITY_ENDPOINT, $resource, $apiVersion
try { Invoke-WebRequest -Method GET -Uri $endpoint -Headers @{ Metadata = 'True' } -UseBasicParsing }
catch { $secretFile = ($_.Exception.Response.Headers["WWW-Authenticate"] -split "Basic realm=")[1] }
$secret = Get-Content -Raw $secretFile
$response = Invoke-WebRequest -Method GET -Uri $endpoint -Headers @{ Metadata = 'True'; Authorization = "Basic $secret" } -UseBasicParsing
$token = (ConvertFrom-Json $response.Content).access_tokenLock the agent down
For sensitive servers, use the agent's local controls. They take precedence over anything set in the cloud:
# only allow the extensions you actually use
azcmagent config set extensions.allowlist "Microsoft.Azure.Monitor/AzureMonitorWindowsAgent,Microsoft.Azure.AzureDefenderForServers/MDE.Windows"
# turn off remote access features
azcmagent config set incomingconnections.enabled false
# only if you don't use machine configuration on this server
azcmagent config set guestconfiguration.enabled falseBeyond that, keep RBAC tight. Anyone who can write to an Arc server resource can install extensions and run commands on the machine, so treat Azure Connected Machine Resource Administrator on your Tier 0 servers like any other privileged role, ideally through PIM.
Day-two operations
Keeping the agent up to date
- Windows: Microsoft recommends Microsoft Update. On domain-joined servers, enable "Install updates for other Microsoft products" in the Configure Automatic Updates policy. Or upgrade silently with
msiexec.exe /i AzureConnectedMachineAgent.msi /qn. - Linux: upgrade through your package manager (apt, yum or zypper) from
packages.microsoft.com. - Either: Update Manager can upgrade the agent, or turn on automatic agent upgrade.
Watching the estate with Resource Graph
Arc servers are queryable in Azure Resource Graph like everything else. A quick health view:
Resources
| where type == 'microsoft.hybridcompute/machines'
| summarize Servers = count() by Status = tostring(properties.status)And Microsoft's sample for servers running an outdated agent:
AdvisorResources
| where type == 'microsoft.advisor/recommendations'
| where properties.category == 'HighAvailability'
| where properties.shortDescription.solution == 'Upgrade to the latest version of the Azure Connected Machine agent'
| project id, JoinId = toupper(properties.resourceMetadata.resourceId),
machineName = tostring(properties.impactedValue),
agentVersion = tostring(properties.extendedProperties.installedVersion),
expectedVersion = tostring(properties.extendedProperties.latestVersion)
| join kind=leftouter (
Resources
| where type == 'microsoft.hybridcompute/machines'
| project machineId = toupper(id), status = tostring(properties.status)
) on $left.JoinId == $right.machineId
| where status != 'Expired'
| summarize by id, machineName, agentVersion, expectedVersion
| order by tolower(machineName) ascTurn the first query into an alert and you'll know about disconnected servers before anyone asks.
Decommissioning a server
Do it in this order, because uninstalling the agent doesn't remove extensions or the Azure resource:
- Remove all extensions from the server in Azure.
- Disconnect: run
azcmagent disconnectas an administrator. This deletes the Azure resource and clears the agent's local state. - Uninstall the agent: through Programs and Features or
msiexec /xon Windows, or your package manager on Linux.
If the Azure resource has already been deleted, use azcmagent disconnect --force-local-only to clean up the server.
What it costs
- Connecting servers and inventory
- Run command, SSH and custom script extension
- Defender for Servers Plan 1 or 2
- Update Manager, per server per day it's managed
- Machine configuration and change tracking
- Log Analytics ingestion
Two ways to bring the bill down:
- Windows Server Software Assurance or subscription licences, through the attestation above.
- Defender for Servers Plan 2, which includes Update Manager and machine configuration for the servers it covers.
Update Manager on Arc is charged per server, prorated daily, and only for days the server is Connected and actually managed by Update Manager.
Troubleshooting
Start here
azcmagent check --location <region>tests every endpoint the agent needs. Run it first, always.azcmagent showshows the agent's status and connection details, including the proxy settings it's using.- Add
--verboseto any command, then read the log:%ProgramData%\AzureConnectedMachineAgent\Log\azcmagent.logon Windows or/var/opt/azcmagent/log/azcmagent.logon Linux. azcmagent logscollects everything into a zip for a support case.
Common error codes
| Code | What it means | Fix |
|---|---|---|
AZCM0018 | Not run as administrator or root | Rerun in an elevated session |
AZCM0026 | Network problem, or a required service is unavailable | Run azcmagent check. With Private Link, pass --private-link-scope |
AZCM0041 | Invalid credentials | Check the service principal ID, secret, expiry and tenant |
AZCM0042 | Couldn't create the Azure resource | Check the onboarding role on the resource group |
AZCM0044 | A resource with the same name already exists | Use --resource-name or delete the old resource |
AZCM0062 | Error while connecting | Read the message. If the resource was created, delete it before retrying |
AZCM0064 | Agent service not responding | Run elevated and restart the himds service |
AZCM0067 | Already connected | Run azcmagent disconnect first |
AZCM0068 | Couldn't look up the subscription by name | Use the subscription GUID |
Usual suspects
- Only the global login endpoint is allowed. Add the regional one, such as
uksouth.login.microsoft.com. - TLS inspection on the proxy. Exclude the Arc endpoints.
- A Log Analytics gateway used as the proxy. It isn't supported for the Connected Machine agent.
FAQ
Does Arc move my servers into Azure?
No. The server stays where it is. Arc creates a resource in Azure that represents it, so you can manage it with Azure tools.
What happens to my servers if Azure Arc has an outage?
Your workloads keep running. Only management through Arc is affected until the service recovers.
Can I put the agent on an Azure VM to try it out?
No. Azure VMs are already Azure resources, and the installer rolls back if it detects Azure. Use a server or VM outside Azure.
Do I need a VPN or ExpressRoute?
No. The agent only makes outbound HTTPS connections. If you want traffic off the public internet, use Private Link, but note that some endpoints still need a public route.
Is there a limit on how many servers I can connect?
Not per resource group or subscription. The only per-resource-group limit is 800 for Private Link Scope resources, and Arc gateway has its own sizing guidance.
Can I rename an Arc server or move it to another region?
Not in place, because Azure resource names can't change. Note and remove its extensions, run azcmagent disconnect, then connect again with --resource-name or a new --location and redeploy the extensions. The agent stays installed throughout.
- Microsoft Learn: What is Azure Arc-enabled servers?
- Microsoft Learn: Azure Connected Machine agent overview
- Microsoft Learn: Connected Machine agent prerequisites
- Microsoft Learn: Network requirements
- Microsoft Learn: Manage proxy settings
- Microsoft Learn: Azure Arc gateway
- Microsoft Learn: Private Link for Azure Arc
- Microsoft Learn: Deployment options
- Microsoft Learn: Onboard at scale with a service principal
- Microsoft Learn: Onboard with Group Policy
- Microsoft Learn: azcmagent connect
- Microsoft Learn: Manage the Connected Machine agent
- Microsoft Learn: Rename or move an Arc-enabled server
- Microsoft Learn: Uninstall the agent
- Microsoft Learn: Security overview
- Microsoft Learn: Managed identity authentication
- Microsoft Learn: Windows Server Management enabled by Azure Arc
- Microsoft Learn: Deploy Azure Monitor Agent with Azure Policy
- Microsoft Learn: Periodic assessment at scale
- Microsoft Learn: Update Manager FAQ
- Microsoft Learn: Resource Graph samples for Arc-enabled servers
- Microsoft Learn: Troubleshoot agent connection issues
- Azure Arc pricing