There are a few gotchas with this one, but we were able to automate it.
Part 1 = Download the latest 64 bit version of the C++ Redistributable - reference article used for info
https://learn.microsoft.com/en-US/cpp/windows/latest-supported-vc-redist?view=msvc-170You need to do this first so you can do part 2.
Part 2 = Install the WebRTC Redirector Service with the .msi installer
Since we're using Nerdio we just run a powershell during the host setup process to accomplish parts 1 & 2. The script downloads the latest versions of the software packages and installs them. I'm sure you could do this in the Azure console but we've used Nerdio to set it up so not familiar.
Part 3 is to install Teams. Note that Parts 1 & 2 MUST be done before Teams is installed or redirection won't work, and you'll have to uninstall and then re-install Teams to get it to work.
You can install Teams with the Teams machine wide installer, but this doesn't really "install" Teams. What it does is place pointers in the registry so that when a new user signs in, Teams will be installed to their user profile. In our scenario, we install Teams as part of the Office 365 package, but the user won't actually see Teams launch until they either reboot the host, or they can browse to Program Files and launch Teams manually. Either method could work; you could add a mandatory reboot to the install or script some kind of program launch, YMMV.
The other thing we have noticed is that even though it is coming down from the MS content CDNs when we install Teams as part of O365, the version of Teams that gets installed is super old. To the user it looks like things are broken but the features are just not in that old version of Teams. We have them kick off a "Check for Updates" inside the program and this seems to help them more than waiting for it to update on its own in the background.
Hope this info helps!