Error Details
| Fact | Value | Source | Note |
|---|---|---|---|
| Exact error string | Error 3702 | Azure Virtual Desktop session host status | -> Needs assistance or Unavailable |
| Affected build range | Windows 11 23H2 | OS Build | |
| Registry key involved | HKLM:\SOFTWARE\Microsoft\RDInfraAgent | Session host registry | -> RegistrationToken |
| Relevant service/endpoint URL | *.wvd.microsoft.com | Network Security Group rules | |
| Log line signature | Event ID 3389, Event ID 1306 | Windows Logs > System and Applications and Services Logs > Microsoft > Windows > TerminalServices-SessionBroker-Client > Operational |
Log Files to Check
C:\Windows\System32\winevt\Logs\System.evtxC:\Windows\System32\winevt\Logs\Microsoft-Windows-TerminalServices-RemoteConnectionManager%4Operational.evtx
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:C:\Windows\System32\winevt\Logs\System.evtxC:\Windows\System32\winevt\Logs\Microsoft-Windows-TerminalServices-RemoteConnectionManager%4Operational.evtx
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 theAllowNewSessions 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 toHKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\RDInfraAgent in the registry and examining the RegistrationToken value.
Fix Procedure
To resolve Error 3702, follow these steps: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.If the session host is in drain mode, disable it using PowerShell:
Update-AzWvdSessionHost -ResourceGroupName-HostPoolName -Name -AllowNewSession $true Restart the RDAgent services on the session host:
Restart-Service RDAgentBootLoader Restart-Service RDAgentIf 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 '
'.
- In the Azure portal: Azure Virtual Desktop > Host pools >
If network connectivity issues are identified, ensure that NSG rules allow outbound traffic to
*.wvd.microsoft.comand*.servicebus.windows.neton TCP 443.
Error Code Variants
| Error Code | Description | Distinguishing Factors |
|---|---|---|
| Error 3701 | Session 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 3854 | Failed 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.
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.