Home › Azure Virtual Desktop › Error 3702

Azure Virtual Desktop · Error 3702 · Windows 11 23H2

Azure Virtual Desktop Error 3702 Windows 11 23H2 Connection Failure

Error 3702 occurs when RD Agent fails or session host is unhealthy; fix by restarting services, re-registering with new token and ensuring network connectivity.

Error Details

FactValueSourceNote
Exact error stringError 3702Azure Virtual Desktop session host status-> Needs assistance or Unavailable
Affected build rangeWindows 11 23H2OS Build
Registry key involvedHKLM:\SOFTWARE\Microsoft\RDInfraAgentSession host registry-> RegistrationToken
Relevant service/endpoint URL*.wvd.microsoft.comNetwork Security Group rules
Log line signatureEvent ID 3389, Event ID 1306Windows Logs > System and Applications and Services Logs > Microsoft > Windows > TerminalServices-SessionBroker-Client > Operational

Log Files to Check

What This Error Actually Means

Error 3702 is a specific error code raised by Azure Virtual Desktop (AVD) when attempting to connect to an unhealthy or unresponsive session host VM. The error signifies that the Remote Desktop Services session host you are trying to connect to is not available, indicating issues with either the AVD session host itself or its connectivity to the AVD control plane. This can be due to various reasons such as service failures on the session host, network misconfigurations, or incorrect settings in Azure Virtual Desktop configurations.

Affected Versions and Scope

This error is particularly relevant for Windows 11 23H2 builds running within an AVD environment. It does not affect other OS versions unless they are similarly configured to use Remote Desktop Services through Azure Virtual Desktop. The issue can occur across different tenant configurations, but it is most commonly seen in environments where session hosts are dynamically managed and scaled based on user demand.

Where To Look First: Logs and Event IDs

To diagnose Error 3702, start by examining the system logs on the affected session host. The critical log files to inspect include: In the System.evtx log, look for Event ID 3389 which indicates a shutdown of Remote Desktop Services. In the TerminalServices-RemoteConnectionManager\Operational.log, search for Event ID 1306 to identify issues with the RD Connection Broker client.

Root Causes

RDAgent Service Failure or Unresponsive Agent

One common cause of Error 3702 is a failure in the RDAgent service, which manages communication between the session host and Azure Virtual Desktop. This can be identified by checking Event ID 7034 in the System log, indicating that the RDAgent service terminated unexpectedly.

Network Connectivity Issues

Another frequent cause is network connectivity problems preventing the session host from reaching necessary endpoints such as *.wvd.microsoft.com. This can be detected by running a connectivity test using PowerShell cmdlets like:
Test-NetConnection -ComputerName rdbroker.wvd.microsoft.com -Port 443
Test-NetConnection -ComputerName rdweb.wvd.microsoft.com -Port 443
If these tests fail, it indicates that the network security group (NSG) rules might be blocking necessary outbound traffic.

Session Host in Drain Mode or Exceeded Session Limits

The session host may also be in a 'Drain' mode where new sessions are not allowed due to maintenance or load balancing reasons. This can be verified by checking the AllowNewSessions property of the session host using:
Get-AzWvdSessionHost -ResourceGroupName  -HostPoolName  -Name  | Select-Object AllowNewSessions
If this is set to False, it means the session host is in drain mode.

Inactive or Expired RD Agent Registration Token

An inactive or expired registration token for the RDAgent can also cause Error 3702. This can be checked by navigating to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RDInfraAgent in the registry and examining the RegistrationToken value.

Fix Procedure

To resolve Error 3702, follow these steps:
  1. Check session host health in the Azure portal: Navigate to Azure Virtual Desktop > Host pools > > Session hosts. Ensure that the session host status is 'Available' and not showing as needing assistance.

  2. If the session host is in drain mode, disable it using PowerShell:

    Update-AzWvdSessionHost -ResourceGroupName  -HostPoolName  -Name  -AllowNewSession $true
  3. Restart the RDAgent services on the session host:

    Restart-Service RDAgentBootLoader
    Restart-Service RDAgent
  4. If the registration token is inactive or expired, regenerate it in the Azure portal and update the registry key:

    • In the Azure portal: Azure Virtual Desktop > Host pools > > Registration key > Add registration key.
    • On the session host: Set-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\RDInfraAgent -Name RegistrationToken -Value ''.
  5. If network connectivity issues are identified, ensure that NSG rules allow outbound traffic to *.wvd.microsoft.com and *.servicebus.windows.net on TCP 443.

Error Code Variants

Error CodeDescriptionDistinguishing Factors
Error 3701Session host is not responding.This error typically occurs when the session host does not respond to health checks, whereas Error 3702 indicates a specific failure in Remote Desktop Services.
Error 3854Failed to connect to RD Gateway.Differentiates due to issues related specifically to the RD Gateway rather than session host availability or service failures.

Verification

To verify that the fix has been successful, monitor the Azure Virtual Desktop portal for a change in the status of the affected session host. The session host should transition from 'Needs assistance' or 'Unavailable' to 'Available'. Additionally, check the system logs again to ensure there are no further errors related to Event IDs 3389 and 1306.

Prevention

To prevent recurrence of Error 3702, implement regular health checks for session hosts using AVD Insights workbooks. Ensure that network security groups allow necessary outbound traffic to *.wvd.microsoft.com. Additionally, configure automatic renewal or regeneration of RD Agent registration tokens through scripts or scheduled tasks.
Warning: Disabling drain mode on a session host can potentially disrupt ongoing sessions if users are actively connected.
A quick diagnostic trick is to use Get-Service -Name RDAgentBootLoader,RDAgent | Select-Object Name,Status,StartType in PowerShell to check the status of RD Agent services without needing direct access to the session host.

Sources & References

Related Guides

Get new error code fixes by email

Product-specific solutions for Intune, Autopilot, SCCM and Entra ID — straight to your inbox. No spam.