Can I host my bot on my own servers?

luoyan xie 0 Reputation points
2023-09-04T06:56:31.2366667+00:00

Hi all,
Due to network requirements, ngrok cannot be used, so I tried to deploy it in a public network environment, but there was a problem, please help!

For Teams bot application development, I made the following attempts:

Use ngrok to expose local services, Messaging endpoint: https://ac0f-38-83-110-5.ngrok-free.app/api/messages
Where https://ac0f-38-83-110-5.ngrok-free.app redirects the teams service to [http://localhost:3007]
===》Can complete the dialogue

Put the service on the public network server, Messaging endpoint: https://domain.com.cn/teams/api/messages
Where https://domain.com.cn/teams redirects the teams service to [http://localhost:3007]
===》Cannot talk

Microsoft Teams Development
{count} votes

1 answer

Sort by: Most helpful
  1. Sayali-MSFT 3,991 Reputation points Microsoft External Staff Moderator
    2023-09-05T07:53:49.4866667+00:00

    Yes, you can host your bot on your own servers. Microsoft Teams provides different ways to run or host your bot during development and production.
    running the bot locally does not give you access to Teams app functionality or Teams-specific bot functions like roster calls and other channel-specific functionality. It is mainly for testing the core logic of your bot.

    For production hosting, you have two options:

    Locally hosted in Teams: This involves running the app locally in tunneling software and creating a package to upload into Teams. This allows you to run and debug your app within the Teams client. You can use tunneling services like ngrok to create a secure tunnel between your local server and the internet. This allows Teams to communicate with your locally hosted bot. You need to update your bot endpoint address with the ngrok URL. However, ngrok free accounts do not provide end-to-end encryption, so if you require encryption, you may need a paid ngrok account.

    Cloud-hosted in Teams: This option simulates the production-level support for a Teams app. You can upload your solution to your externally accessible server or cloud provider of choice and create a package to upload into Teams. This allows your app to be hosted in the cloud and accessed by Teams users.

    When hosting your bot on your own servers, you need to consider scalability, performance, and security aspects. For example, application-hosted media bots require more compute and network capacity than messaging bots and may incur higher operational costs. You also need to ensure that your bot can handle the expected number of simultaneous calls and consider the hardware requirements for media processing.

    To learn more about hosting and debugging your bot in Teams, you can refer to the Microsoft Teams documentation.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.