問題
在企業內的 Teams Bot ,Firewall 要怎麼設定才能讓使用者在 Teams 中可以順利跟 Bot 對話呢?
解法
在開發 Bot 時,通常會透過 ngrok 來測試,所以可以看到 teams 打過來的 ip 是 52.187.55.201,
但下次測試又是別的 ip ,直接請網管設定 firewall 允許進來的 ip 為它又不太保險。
後來有查到 Bots Secured Behind a Firewall & Teams ,
Ingress 設定為允許 52.112.0.0/14,Egress 設定為允許 52.112.0.0/14,login.microsoftonline.com 及 login.botframework.com。
後來再問 Microsoft Support 則建議參考,Office 365 URLs and IP address ranges-Skype for Business Online and Microsoft Teams 中的 ID 12 的部份,
FQDN 則設定 *.lync.com, *.teams.microsoft.com, teams.microsoft.com
IPv4 則設定 13.107.64.0/18, 52.112.0.0/14, 52.122.0.0/15, 52.238.119.141/32, 52.244.160.207/32
IPv6 則設定 603:1027::/48, 2603:1037::/48, 2603:1047::/48, 2603:1057::/48, 2603:1063::/38, 2620:1ec:6::/48, 2620:1ec:40::/42
當然,還是要隨注 Office 365 URLs and IP address ranges-Skype for Business Online and Microsoft Teams 有沒有改變哦~
參考資料
Bots Secured Behind a Firewall & Teams
Office 365 URLs and IP address ranges-Skype for Business Online and Microsoft Teams