To restrict P2S VPN connections based on Microsoft Entra groups across multiple gateways, custom audience App IDs are required. First, you must register separate enterprise applications (App1 and App2) for each gateway and assign Group1 and Group2 respectively to restrict access. Next, expose an API by adding a scope to both custom apps. Then, authorize the official Azure VPN Client by adding its specific application ID as a client app to both App1 and App2. Finally, configure the Point-to-Site settings on VPNGW1 and VPNGW2 in the Azure portal, utilizing the custom Application IDs of App1 and App2 as the Audience values.