I have made a bot but I want to deploy it to a personal server. I have tried to do research before posting a question but I haven't found anything online that really answers my questions. So, I know to deploy the bot to a server I need to use Web Deploy but I was wondering how the messaging endpoint gets set up? Would I simply be able to call https://myserver/mybot/api/messages without any setup? Sorry for my poorly worded question, I am new to this.
@megancooper
If you want to deploy it on your personal server then it should be an HTTPS server.
STEP To DEPLOY :
DONE.
Your question is about messaging endpoint. In fact, this "magic" is done by ASP.Net as you can see in your WebApiConfig.cs file located in App_Start in your project:
```C#
// Web API routes
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
```
This is how messages coming to https://yourServer/api/messages are routed to MessagesController
You can have a look to more documentation here: https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/routing
@megancooper
The Bot Framework works with bots deployed on any hosting service, cloud or on-prem, _as long as you have an internet-accessible endpoint and a valid HTTPS cert._
The Bot Framework requires that the x.509v3 certificate exposed by your endpoint be current and valid. Most of the checks for "current and valid" are standard checks for server certs: the CN must match the hostname, it must not be expired, it must not be listed in a CRL, it must have the correct set of EKUs, etc.
Most importantly, your cert must chain to a root certificate authority trusted by Microsoft. The latest list of these CAs is available here: http://social.technet.microsoft.com/wiki/contents/articles/31634.microsoft-trusted-root-certificate-program-participants-v-2016-april.aspx
For more information on deploying your bot, see: https://docs.microsoft.com/en-us/bot-framework/deploy-bot-overview
Relates to:
I have successfully deployed the bot and am trying to access it from the bot emulator using:
https://localhost/MyBot/api/messages and this connection is successful. However, when I send a message I get a Request to 'https://localhost/Bridget/api/messages' failed: [500] Internal Server Error in the emulator. Is this because I need to use tunneling software like ngrok to chat with the bot? Or can I actually do this through local host?
Or do I need to change the https:// endpoint to api/messages. Currently IIS has it as simply https://localhost/MyBot
If so, how do I accomplish this?
@sayyednazeer @nrobert @nwhitmont Thanks for the help. I was wondering if anyone knew how to solve the above issue ^^
@megancooper did you solved this issue? I'm new at this topic so I wan to learn how to deploy a bot in my server.
Sorry @AmiirArtz it's been a while and I can't remember what I did to resolve the issue. (I believe it had something to do with allowing post requests to the app through IIS settings.) Are you experiencing the same issue?
Yes, now im developing a basic MVC program with the chatbot embeded inside... I'm giving a try to everything lol to get the bot working somewhere...
I think this post has what Megan has said
Your question is about messaging endpoint. In fact, this "magic" is done by ASP.Net as you can see in your WebApiConfig.cs file located in App_Start in your project:
// Web API routes
config.MapHttpAttributeRoutes();config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
defaults: new { id = RouteParameter.Optional }
);
This is how messages coming to https://yourServer/api/messages are routed to MessagesController
You can have a look to more documentation here: https://docs.microsoft.com/en-us/aspnet/core/mvc/controllers/routing
Is this applicable for SDK 4 as well?
And the main thing is installing "The .NET Core Hosting Bundle" from here : https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/?view=aspnetcore-3.1#install-the-net-core-hosting-bundle
I've spent 2 days to find only because of this it was giving 500 error as 500 is generic error and doesn't give clue.
Most helpful comment
https://stackoverflow.com/questions/44558760/deploy-bot-in-local-iis-and-incle-it-in-custom-chat-in-a-webpage/44571251#44571251
I think this post has what Megan has said