- Azure VM Networking or Firewall: By default, Azure VMs do not block WebRTC media traffic, but you need to ensure that the necessary ports are open in your Azure Network Security Group (NSG) rules. WebRTC typically uses UDP for media traffic, so you should allow UDP traffic on the relevant ports.
- HTTPS Requirement: Yes, HTTPS is mandatory for browser microphone access and WebRTC media permissions in production environments. Browsers enforce this security measure to protect user privacy, and without HTTPS, the microphone permission prompt will not appear.
- STUN/TURN Servers: Yes, configuring STUN/TURN servers is essential when deploying WebRTC applications, especially in scenarios where clients are behind NAT or firewalls. STUN servers help clients discover their public IP addresses, while TURN servers relay media when direct peer-to-peer connections cannot be established.
- Azure NSG Rules for WebRTC: You need to create specific NSG rules to allow traffic on the ports used by your application. Typically, you should allow inbound UDP traffic on the ports used for WebRTC media streaming, which may include ports 3478 (STUN), 5349 (TURN over TLS), and the range of ports used for RTP (media streaming).
For optimal configuration, ensure that your application is served over HTTPS, configure the necessary STUN/TURN servers, and set up your NSG rules to allow the required traffic. This should help resolve the issues you're facing with microphone permissions and audio streaming in your WebRTC application on Azure.