I solved this problem by installing the WebRTC Redirector service. Microsoft has official documentation for installing Teams on Azure Virtual desktop. Following the instructions from there, I was able to redirect the webcam image to Teams on the Session Host. Here's what needs to be done to make the camera work in Teams:
- To redirect local devices from the desktop client to a remote session, make sure your RDP properties are set to the following:
audiocapturemode:i:1
audiomode:i:0
camerastoredirect:s:* - To tell Teams, that it will be used in Session Host, set the following registry key:
2.1. Run Registry Editor and navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ **
2.2. Create the **Teams key if it doesn't already exist.
2.3. Create the IsWVDEnvironment DWORD value for the Teams key and set it to 1 - Install the Remote Desktop WebRTC Redirector Service.
By default, after installation, the service will be automatically enabled and started. After installing the service, you need to quit Teams and open the application again (in some cases it needs to be done twice).
To make sure the installation was successful, you can start the Teams application, and click the ellipsis which is to the left of your user profile icon in the navigation bar, and then select About → Version. Then you will see that WVD Media Not Connected or WVD Media Optimized appears next to the Teams version, this means that the installation was successful. In my case, it was WVD Media Not Connected, but the camera started working on the Windows virtual desktop.