microsoftgraph / microsoft-graph-comms-samples

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

Running Huebot locally #766

Open anuj018 opened 1 month ago

anuj018 commented 1 month ago

Describe the issue I'm getting an error which states Cannot access the certificate's private key as well as The certificate key algorithm is not supported. Furthermore I dont understand how the traffic is directed from my custom domain to all the other functions or ports if I set up a CNAME for my domain to point to X.tcp.in.ngrok.io. Also, do we require some sort of a paid ngrok subscription for the domain to point to ngrok? Furthermore, how is opening an ngrok port to 9442 helping out. Its details are never specified anywhere in the application. Im just wondering if anyone has ever deployed the Huebot example locally and successfully.

InDieTasten commented 1 month ago

The Microsoft Teams Platform needs to be able to contact your bot via HTTPS and TCP. Wherever you host your bot, it needs to have ports available for HTTP and media signaling via TCP. If you host the bot locally, chances are you are behind a NAT or other firewalls. That's what ngrok is for. It provides a public IP + port combination and tunnels it towards your machine, circumnavigating any NATs. When you deploy the bot to Azure, another cloud, or on premise DMZ, you usually set up rules to allow the traffic instead. So no ngrok required.

If you want to use ngrok for local development, you will need a paid version of ngrok that allows for TCP traffic. Since TCP traffic requires IP based routing.

Regarding certificates, you will want to follow the sample docs and issue a certificate via Let's encrypt for whatever domain you are planning to use as host name of your bot. In case you use ngrok, you will have to perform HTTP challenge with some ACME client, as you don't have domain authority over the ngrok domains.

Hope this helps somewhat. Teams bot development has a pretty steep learning curve at the beginning, as it throws a lot of ops and networking tasks at you before you can really do anything.


If you are interested in consulting or development services for Teams Apps/Bots, feel free to email me. Details are on my profile page.