Proactive Conversations - azure

https://docs.botframework.com/en-us/node/builder/chat/UniversalBot/#starting-conversations
I've been successful at using this approach in the emulator environment, where the MS bot templates use the ChatConnector and a restify server to process incoming requests.
Can it also be used when deploying on the Azure Bot Service? In that environment the bot templates generally have you using BotServiceConnector and there is no restify server.
I added one to listen on a specific port so that I could try and trigger the proactive beginDialog. I'm getting literally no response.

Since this is Node.JS Bot Framework and not a Bot Service (these are different), you should try deploying to a new Azure Web Service using the Node template. You can do a search for the Node template when creating it.
After that, the Web Service will listen on port 80 by design and respond appropriately. The local settings are for debugging locally AFAIK.

Related

Hosting bot locally on 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.

Whats the difference / connection between Azure App Service and Web App Bot?

I would like to understand what Azure does while creating a Web App Bot in Portal.
An Azure Bot Service Bot deployed to an Azure App Service Web App...
After creating a bot with Azure Bot Service i got the following ressources:
What's the difference or the connection between the resources (Web App Bot and App Service)?
The code should be located in Web App Bot right? Here the magic happens, development, channels, etc.
The user is interacting with the App Service throw an HTTP call. What happens if App Service receives the call?
And why I could configure CD on the App Service instead of Web App Bot?
From my understanding, the Web App Bot is the "locale" Bot I'm publishing to App Service to make him available?
Can anyone help me out to get a clear understanding?
Let us break down the different components involved.
The Web Bot (which is a web application) needs a web site to be deployed to. That is the App Service. That web site needs a web server to run on. That is the App Service Plan.
The Web Bot is the main part which you configure. The other components are infrastructure components and you don't need to worry about them much.
Your bot is actually an API, which will be hosted on App Service. So in case your bot receives many requests, You'll scale App Service to handle that.
Web App Bot is where you enable and configure the channels your bot will work with (e.g. Direct Line for voice)

Best way to get notifications to Angular Client from an Azure hosted Web API

Best way to get notifications to Angular Client from an Azure hosted Web API
I'm creating an app where users can interact on articles. The back-end is asp.net core 2 web api. Front end is nodejs Angular universal app. I've decided to host on azure.
I need to get user notifications from server to the client. So if an user wrote a document and another user liked it, the notification will be sent to the user that wrote it, if the user is running the site.
I know I can achieve this using SignalR or Socket.io, but I was looking for something that azure provides.
Is there anything in azure that I can use, such as Event Hub, Event Grid or NServiceBus where there's already a javascript client that works on the browser, listening on Events?
hi best way notification is azure web job with azure web hook
using web job you can get notification to any devices
for more details please see
enter link description here

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.

Push Notifications RESTful WebApp Angular2 / NodeJS

I'm working on a Restful Web Application. I divide frontend and backend, using Angular2 for the front, and NodeJS for the back.
I would like to use Notifications and push them to specific users.
Sample : If my user decide to subscribe, he could get a Desktop notification when I decide to send one or if my NodeJS serveur want to send a message to a user group.
I have seen a lot of differents modules for the frontend and backend, but I'm a little bit lost.
Architecturally, how should I add this service in my application?
Should I use specific node modules?
You talk about desktop notifications. I guess you want the user to receive its notifications also when the browser or app is closed. In that case you need a Service Worker. A Service Worker is a script that your browser runs in the background, to which the message is being pushed when the browser or app is closed. For a nice introduction to Service Workers, read this. Angular has a Service Workers implemented in production version since 5.0.0. Klik here to read more about it.
At the backend you need a special Node module to send the notification. For instance node-pushserver, but there are many others. This special node module connects to a messaging service whom actual send the message. You can use for instance Google's cross-platform messaging solution Firebase Cloud Messaging (FCM) (the successor of Google Cloud Messaging (GCM)). It can send to Web, iOS and Android.
At the client side you need to register the Service Worker for push notification. Then you will get an endpoint that needs to be stored at the node server side. You send a push request with this endpoint to the messaging service every time.
You can also make use of a paid push notification provider to do the job. Click here for a list of them.
Setting up a WebSocket connection (like socket.io) won't work since it can't stay connected with the Service Worker.
You can use WebSockets for pushing data from the Node.js server. Add the ws package to your server's package.json. Take a look at the BidServer.ts here: https://github.com/Farata/angular2typescript/tree/master/chapter8/http_websocket_samples/server/bids
The Angular client is here: https://github.com/Farata/angular2typescript/tree/master/chapter8/http_websocket_samples/client/app/bids

Resources