Hosting bot locally on IIS - iis

First of all I know that there are similar questions like this, but by going over all of them I realized that not single one contains all the steps to host bot on local IIS, which is why I am asking this question to collect all the info in one place. So please before flagging this as duplicate take a moment to try answer this question once and for all for everyone first.
Now that said. I have created a bot using the Bot Framework Composer and successfully published it to the Azure. Everything is working fine, but I would like to move it away from Azure to on-prem IIS server. By looking around I was only able to find these somewhat comprehensive Chinese instructions.
Steps that I did:
Install IIS
Install .NET Core Windows Server Hosting Bundle from here
Created new AppPool and set it to No Managed Code
Downloaded bot from FTP on Azure and stored in local folder
Created new website on port 8080 and pointed it to the local folder
After this I am able to reach website that is telling me that the bot is ready for use on http://localhost:3978/api/messages. But when I try to connect to it by using Bot Framework Emulator it is unable to connect and I am getting error
POST 400 directline/conversations//activities
By looking at the netstat I can see that there is actually nothing running on port 3978 which leads me to believe that the IIS is running just the website and not bot itself. Any idea what I am doing wrong?

You mentioned in 5th point that
Created new website on port 8080 and pointed it to the local folder
but you are checking the bot is running in http://localhost:3978/api/messages which is the visual studio when you run this endpoint creates i think.
can you check the endpoint with port 8080 endpoint.
I think you need a https endpoint to make the bot work and also you need to enable that IIS endpoint with public accessible in internet so that you can connect it in the bot channel registration or Azure Bot channel.

Related

Hosting Microsoft BOT on Enterprise Cloud?

We are trying to host the BOT on the Enterprise server IIS server which is an internet server visible to Microsoft and other outside public domains.
So, after hosting the BOT on the enterprise cloud server we would get an endpoint ex: https://myenterpriseserver.com/api/messages.
Can I use the above endpoint to register the bot in the microsoft's dev.botframework.com?
Please help, as we are planning for a large scale implementation of the BOT.
Thanks,
Mahesh
As long as the server has a SSL Certificate it should work assuming you deploy the bot correctly. Test it out first by using the Bot Emulator to see if you can send a receive messages from a computer in your system's network. Next try registering the bot on Microsoft's Bot Framework and seeing whether Microsoft's Bot Connector service can connect to the bot successfully.
Your system/intranet may block outside messages from Microsoft in which case you will have to change some settings, etc. with your firewall. This GitHub Issue follows an issue with white-listing Microsoft's Bot Connector service.

Web Deploy unable to validate connection

I am trying to learn how to setup Web Deploy functionality on both sides Server and host/client computer. Created a Windows Server 2012 Web Server in Hyper-V and able to access default web page in host/client computer. On server installed Web Maintenance Service, Web Deploy 3.5 and performed all the required steps e.g. "Configure Web Deploy Publishing" and added Administrator to IIS Manager Permission for the website in IIS. I disabled Firewall totally to make it work for the first time.
On client computer I created a dummy MVC Application in Visual Studio and trying to create publish profile for this app. As soon as I hit the Validate Connection I got the option to receive and save the security certificate from server but after that in gives me following warning (snapshot):
Tried doing all the steps all over but no luck.
I am open to all feedback. Thanks in advance.
Found the solution. Instead of adding publish information manually, I am suppose to use publishsetting file generated in server through "Configure Web Deploy Publishing" feature of IIS. Server address ends with file name which ends with .axd

Unable to get reply from bot created with BotFramework hosted in Azure with database connection

The bot that has been developed runs in the emulator locally without any problem.
But when we hosted it in Azure. We're not getting any reply from bot.
I tried testing the Bot Connection in dev.botframework.com, I get an "Endpoint authorization succeeded message".
can anyone let me know what could be the issue.?
The issue is fixed now.
I removed the database connection string from web.config file and configured it in Azure Web App service -> Application settings.
I gave the connection string name I gave in MessageController.cs while creating it through ConfigurationManager.connectionString
ConfigurationManager.ConnectionStrings["ConnectionStringName"].ConnectionString
Also, I updated the BotBuilder from v3.0.0 to v3.0.1 as it had a bug fix with Bot.Connector which I had used in my code.
Both these changes helped.
Arjun
As you mentioned in the question, it works well in localhost. But when you host inside Azure app services it doesn't work. If end points are working properly you will normally get default message from the Bot whether you're connection to a DB or not. Please check your endpoint,
When you connect to the azure your endpoint will look like,
http://azuregetstartessamplebot.azurewebsites.net
But keep in mind when you adding that URL as your endpoint, include https instead http and add /API/Messages in the end of your URL. Then final endpoint URL looks like,
https://azuregetstartessamplebot.azurewebsites.net/API/Messages
hope this answer will help you. Try it. Cheers!

setup azure server for outside access

How do you deploy a website in Windows Azure so that it can have outside access? I'm not that familiar with it and I have no idea where to start.
All the info I have is that I have a cloudapp.net website. I can access my remote desktop through .cloudapp.net. And I have an IIS Manager.
This all sounds stupid, but I need to start somewhere. And I need help. Thanks.
EDIT: More info. From my extensive search, I found that endpoints might do the trick. I want the website to be accessed through a port (sample.cloudapp.net:1010). I did some tinkering on it but I couldn't make it work.
If you already have a cloudapp.net website, it means that you have a cloud service for your website. You could take a simpler approach and set up a Web App instead, which would give you an azurewebsites.net domain. Either way, the full domain name will be a public URL for your website available at port 80.
If you prefer to stick with a cloud service, check out the official documentation:
https://azure.microsoft.com/en-us/services/cloud-services/
If you opt for a simpler Web App (my recommendation for beginners), the following URL contains links to documentation and a short video to get started with Web Apps:
https://azure.microsoft.com/en-us/services/app-service/web/
Web Apps can be deployed in multiple ways, including Visual Studio, FTP or Continous Integration directly from source control. If you need help with deploying the web app, I have a step by step guide and video tutorial:
http://wakeupandcode.com/deploy-your-web-site-web-app-on-azure/
Hope that helps! :)

Cannot Connect to Windows Azure VM (Server 2012 R2) Web Deploy Service

I can't seem to be able to deploy a site to a windows server 2012 r2 running IIS and Web Deploy in Azure VM. I have verified that the port is open, the credentials are correct and the site name as well. I tried using http: and https: also tried using msdeploy.axd end point and the MSDEPLOYAGENTSERVICE one nothing. Check is the services are running and if I can connect to the machine which at can on port 80 to the default site. Tried connecting from multiple connections I get the same result...
Could not connect to the remote computer ("<computer name>.cloudapp.net"). On the remote computer make sure that Web Deploy is installed and that the required process ("Web Deployment Agent Service") is started. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_NOT_REACHABLE. Unable to connect to the remote server.
After dealing with this for about an hour now, I figured out how to fix this on my Azure Virtual Machine.
First the obvious
Check that port 8172 (if you're using default settings) is open in your firewall
Check that the processes MsDepSvc and WMSVC are running.
Check that the site name is correct.
Management Service
In ISS, at the root level of the server, check your settings under Management Service.
It should have Enable Remote Connections checked:
Did you download the full package
This was the one that got me, I hadn't installed everything.
On the bottom of the WebDeploy page: http://www.iis.net/downloads/microsoft/web-deploy
You can download the full package, and then just install everything.
You don't mention if you have an endpoint configured for your Azure VM. If not, make sure you create an endpoint with a private port of 8172.
EDIT: Here is a troubleshooting guide for web deploy that includes the error message you've encountered. Additionally, from my own experience I have managed to mistype the site name and not install .NET and seeing similar errors.
Helpful but in the end in our case it was TLS mismatch. Check both machines can do TLS 1.2 if you are forcing it. Have put more detail here https://fuseit.zendesk.com/hc/en-us/articles/360000328595. Cheers

Resources