microsoftgraph / microsoft-graph-comms-samples

Microsoft Graph Communications Samples
MIT License
211 stars 236 forks source link

8445 connection pointing to Application Gateway instead of the VM in Microsoft Teams Policy Recording Bot #642

Open ueshiman opened 1 year ago

ueshiman commented 1 year ago

I am developing a compliance recording. [https://learn.microsoft.com/en-us/microsoftteams/teams-recording-policy] I refer to PolicyRecordingBot from [https://github.com/microsoftgraph/microsoft-graph-comms-samples] and port it to Owin Self host. It works when calling the Bot's web hook from an Virtual Machine or Load Balancer of Azure, but fails to connect via the Application Gateway of Azure. The failure reason looks like the 8445 connection is pointing to the application gateway instead of the VM. I confirmed that the IP of the VM is specified in SetMediaPlatformSettings in Bot.cs, but the acutual connection seems to be connected to the application gateway. May I know that is there a structure to connect 8445 to the IP of the api/calling response source instead of the SetMediaPlatformSettings setting? Also, in the configuration using the application gateway as above,is there a way to make the 8445 port connection directly communicate with the IP of the VM without going through the application gateway?

コンプライアンスレコーディングの開発をしています https://github.com/microsoftgraph/microsoft-graph-comms-samples のPolicyRecordingBotを参考にしてOwin Self host に移植して使っています。 Botのweb hook をAzureのVMや、ロードバランサーから呼び出す場合には動作するのですが、アプリケーションゲートウェイ経由だと接続に失敗しています。 8445の接続がVMではなくアプリケーションゲートウェイを向いているようです。 Bot.cs内の SetMediaPlatformSettings でVMのIPを指定しているのは確認できていますが、アプリケーションゲートウェイに接続に行っているようです。 ここで確認ですが、SetMediaPlatformSettingsの設定では無く、api/callingのレスポンス元のIPに対して、8445の接続をするような仕組みになっているのでしょうか? また、上記のようなアプリケーションゲートウェイを使った構成において、 8445ポートの接続はアプリケーションゲートウェイを経由させずにVMのIPと直接通信させる方法は無いでしょうか?

tamagoeggo commented 1 year ago

You might want to check out Recall.ai - that way you don't need to deal with this bot infra, debugging and maintenance.

1fabi0 commented 1 year ago

I assume as the Azure application gateway is working on layer 7 it doesn't know how to process the media plattform request, but you can create one public port per vm for the media plattfrom on a loadbalancer and specify in the bot configuration the public port for that vm instance at the loadbalancer instead of 8445 for the public media plattform port, I'm not fully sure if the loadbalancer directly can do such a mapping but reverse proxies like nginx can do tcp reverse proxy and map the traffic on one public port to a vm, e.g. the teams-recording-bot sample for k8s does do this for example.