The benefits of hosting a bot on Azure Bot Service compare to hosting a bot on a typical Web App hosting - botframework

A bot is essentially a web API and so it can be hosted on any web service.
I am abit confused when one of the following approaches should be prefered over each other:
Option #1 Host a Bot on Azure Bot Service
Option #2 Host a bot as a plain PaaS Web API
Currently I am hosting my bot on a plain Azure PaaS App Services. It is working very well.
However, I expect there must be some advantages to hosting a bot on Azure Bot Service.
When I go through the documentations the following example shows how to Create an Azure Bot Service in Azure Portal, download its code, change it then deploy it again to the same Azure Bot Service:
https://learn.microsoft.com/en-us/azure/bot-service/bot-service-build-download-source-code?view=azure-bot-service-4.0
In contrast, the following example shows how to build a bot in Visual Studio and publish it to an Azure Web App:
https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-howto-deploy-azure?view=azure-bot-service-4.0
What are the advantages of hosting a bot on Azure Bot Service?
Is there any resource or article that contrasts the two options?

They are essentially the same thing under the hood. A bot is basically just an API endpoint so there are many ways to host you bot. If you create A bot service you get options to add other services from the creation page. Whereas if you just create a web app or app service you will have to manually add these things.
Creating a Web App Bot will allow you to all in one step create:
Bot Channels Registration
Choose a template to start with
Configure a Luis app
Add Azure Storage
Add application insights

Related

Bot Framework Emulator works but Web Chat not does not

I have a bot, built using the Bot Framework V4 in Java with Spring Boot, that is hosted on an Azure Web App and using the Azure Bot Service.
When connecting with the Bot Framework Emulator using ngrok it works just fine but when I try to use the Web Chat channel in the bot service I get this error
There was an error sending this message to your bot: HTTP status code Unauthorized
When trying to open it in Teams using the Teams channel it also doesn't work.
I have left the MicrosoftAppId and MicrosoftAppPassword empty and have my messaging endpoint set as https://<name>.azurewebsites.net/api/messages.
Is there any way I can use web chat?
When testing with a locally running bot (with using local url), you don't need to specify MicrosoftAppId/MicrosoftAppPassword within Emulator. But when the bot is deployed to Azure (OR testing when running locally but through with ngrok), you need to configure them in either the Web App configuration or in the application.properties file.

How can I create a custom screen in the messaging section in Microsoft Teams add-on

I don't want to use bot framework in pop-up or chat window.
Can I use the web API I created myself.
When I do a call, I want the api to request it to list the returned data.
Can I select multiple data listed?
From your description you seem to want to create a Teams Message extention, specifically a search extention that will be used from the compose box.
this is indeed powered by a webservice that you will write and host,
however the communication channel between Teams and your webservice must use the bot framework for communication.
Note that you do not need to write a chatbot as such;
I like to think of it as the 'communication channel' between all the Teams clients that have your app installed , and your webservice.
High level steps:
Create and deploy your web service (while developing use a tunneling
service like ngrok to run it locally)
Register your web service with
the Bot Framework
Create your Teams app package
Install your App into Teams
More steps and details in the messaging extensions documentation

Using BotFramework DirectLine without Azure Bot Service

I am looking to create a Bot integrating the Bot Framework DirectLine API that they offer.
But, I wanted the service to be Cloud Service agnostic. So, the idea is to use the BotFramework capability to start the conversations and persist the conversation cache using the conversation id it generates but the business logic can be on any cloud service (AWS/Google/IBM Cluod) etc.
Is it possible to design the same using the DirectLine API's with out getting bound to using Azure Bot Service?
https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-directline?view=azure-bot-service-4.0
https://learn.microsoft.com/bs-latn-ba/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-receive-activities?view=azure-bot-service-3.0
The Bot Framework works with bots deployed on any cloud hosting service, as long as you have an internet-accessible endpoint and a valid HTTPS cert.
This issue explains on how you can run your bot on IIS or any other bot hosting service.
One example of an unofficial implementation of directline that does not require Azure is offline-directline. This example sets up a local web server that emulates the DirectLine API and tunnels the requests through to your bot.
With respect to hosting your bot on IIS or any other cloud services, keep in mine that
'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.'
Note: offline-directline is an unofficial private package and bot framework container support is not officially supported. Refer to this answer on using localized version of Direct Line API with botframework.
Hope this helps.

How to connect local hosted Azure BOT from your web application

I have created an BOT with Microsoft BOT Framework and published in local IIS. Now I want to connect that from my web application, So far I found this could be only possible through direct line from azure portal. Is there any other way to do that?
Now I want to connect that from my web application, So far I found this could be only possible through direct line from azure portal. Is there any other way to do that?
In my opinion, the Microsoft BOT Framework application is just a service which provide the bot endpoint. You could host it in anywhere.
If you want to connect to your web application or something else. You need to use a channel to connect the bot with other application. You should register the bot and enable the channel to let your bot work. The Azure provide multiple chanels to register the bot like webchat. You could also build the channel by yourself, but you should think about a lot of things.
More details, you could refer to below answer:
How to connect local hosted Azure BOT from your web application

deployment of the bot in microsoft bot framework

is there possible to deploy our bot in visual studio our project bot in azure resources is there possible to deploy??
also with database and mail sending SMTP server
we have subscription and all
then how to deploy bot in azure
You can deploy you bot to Azure. Its a MVC WebApi project like others. If you need SMTP mail, you can use services like SendMail to that. For Databases, you can also use one of the many that azure provides (eg. DocumentDB, SqlAzure).

Resources