I started learning Microsoft bot and coming across different environments to build and test. I am trying to understand the exact purpose of all environments.
Bots can be developed using Visual Studio using c# or Node.js in our local machine after downloading the Bot Template. Also, It can be tested in our local development machine using the Bot Emulator. I am clear till this point.
In one article, I could see that Bots can be built using https://dev.botframework.com/bots. When should we go for this environment?
Also, Bot Service can be enabled in Azure (portal.Azure.com). How it differs from the previous dev.botframework.
Can someone clarify?
If you are developing a bot locally, the environment you described is perfect.
However, once you want to allow others to access your bot and from different channels (Facebook Messenger, Skype, etc), you will likely host it in a cloud platform, let's say, Azure. Once you do that, in order to allow the Bot Framework infrastructure to interact with your bot you will have to authenticate your bot against that infrastructure. For that to happen, you will have to register your bot in https://dev.botframework.com/bots whereyou will get your Microsoft AppId and your Microsoft AppSecret, that then you will use in your bot code (in C# in the Web.config, in Node.js usually in a .env file).
You can read more about this on the How the Bot Framework works documentation topic.
Regarding Azure Bot Service: it an integrated environment that is purpose-built for bot development, enabling you to build, connect, test, deploy, and manage intelligent bots, all from one place. You can write your bot in C# or Node.js directly in the browser using the Azure editor. Your bot is automatically deployed to Azure.
You can read more on https://azure.microsoft.com/en-us/services/bot-service/
Related
I am building a Teams App which uses a search based messaging extension. As far as I understand, I need a bot for this, because the bot is basically posting the adaptive card created from the data on my external webapp to the chat.
Is it possible to create or host a bot somewhere else than in Azure? I do not have an Azure subscription. If so, how would I go about using a different Bot for my Teams App?
Thanks for helping in advance!
Teams bots rely on the underlying Microsoft Bot Framework - the same engine for building any kinds of bots in the Microsoft ecosystem (e.g. slack or web or facebook bots). The only way to register those bots in MS Bot Framework is, yes, via the Azure portal. However, you don't need to HOST your bot in Azure - the physical web endpoint can live anywhere that's publicly httpS addressable (e.g. AWS), as long as the registration for the bot is in Azure.
yes, you can create the Bot framework locally and run it using Visual Studio.
To debug Bot locally in teams you need to use a tunneling service like ngrok.
To install ngrok run the following command.
ngrok http <port> -host-header=localhost:<port>
Here is document related Bot framework running locally and the installation steps for ngrok.
Bot Framework SDK documentation says that Web App Bot is deprecated. But there is no information about the difference between development with Azure Bot and (deprecated) Web App Bot. What exact changes should be done if we migrate form one service (Web App Bot) to another (Azure Bot)?
In regards of other contributor's answer, I think main concept and
queries has not explained accordingly, so I felt it requires more
explanation in addition to clear the OP's main concern.
Questions: But there is no information about the difference between development with Azure Bot and (deprecated) Web App Bot.
The Bot Service behind Azure Bot and Web App Bot/Bot Channels Registration is the same; the change is in how the resources are
created that you use in your bot such as web apps, language
understanding, and more.
Rather than the one size fits all templates that the Web App Bot used,
Bot Framework Composer can be used to create resources for the Bot
with much more flexibility than the Web App Bot templates allowed.
Bot Channels Registration and Azure Bot are basically the same
capabilities renamed. The UX is slightly different in the Azure Portal
to help customers connect to the Bot Framework Composer.
Its clearly documented here in the official document you can get here
Questions: What exact changes should be done if we migrate form one service (Web App Bot) to another (Azure Bot)?
Currently migration from Web App BottoAzure Bot isn't supported.
If your Web App Bot isn't being used in production, you can delete
your old Web App Bot resource and reuse the bot name and app ID in a
new bot resource (after some time for the old record to get deleted).
The new Azure Bot is designed around creating your bot using
Composer, Bot Framework SDK, and so the gains from such a migration
would be minimal. You can get the official explanation here
Note:
Now you might be wondering, what about your existing Web app bot. Your bot and other resources will continue to work without any problem and you don't need to migrate your old web app bot in this aspect.
One question may arise,then why its been depricated or no longer be used?
The answer would be, Functionally though Azure Bot, Web App Bot, and
Bot Channels Registration all utilize the Bot Service in the same way
"under the hood". The Azure Bot path is easier, and more
configurable for developers in comparison of Web app bot
Hope above explanation will redeem your concern.
The Azure Bot is like the Bot Channel Registration. It is a global resource that identifies your bot to toher Azure resources and contains configurations and settings for the bot's external messaging endpoint, channels (Teams, Web Chat, Email, etc.), Exposing APIs, OAuth settings, and more.
To actually host the bot, you would use an Azure App Service. You would create one during the deployment process.
As the stated in the linked docs, existing resources will continue to work. Note that the docs specify that migration is not supported. Moving forward, when you build a new bot, you should use a combination of an Azure Bot for identity and configuration and an App Service to host and run the bot.
I have an MS Teams bot that is built on .NET Core and works OK. However, for reasons, I have been asked to port this bot to .NET Framework and deploy it to a Service Fabric Cluster.
Although I can back-port the code to .NET Framework and deploy it to a local Service Fabric Cluster, I am struggling to get the bot to interact with the Bot Framework Emulator (if I use empty strings for the ID and Password, I get Unauthorized errors; if I supply dummy ID and password values, it complains that the Bot is not registered with botframework.com).
Even assuming I get it to work with the emulator, it is not immediately clear to me how I will integrate it with MS teams (since it is not running as an Azure App Service).
So, before I go much further with this, is what I attempting possible, or is this a dead-end?
If it is possible, is there any guidance/documentation available to help me? Everything I can find assumes .NET Core + Azure App Service.
I would like to understand how payments work as far as Microsoft Bot Framework is concerned.
This is my scenario: In Visual Studio Code I wrote an bot app using Microsoft Teams Toolkit to use it as a chatbot in Microsoft Teams. My company has an Azure Active Directory subscription, so my bot app appeared there. This app communicates with an endpoint which is NOT hosted on Azure.
So my question is - will it generate any extra costs? Should I worry about this 10000 messages per month limit?
https://azure.microsoft.com/en-us/pricing/details/bot-services/
As I understand I'm not using Azure Bot Services as I host my endpoint and I'm taking care of the logic, am I right?
My endpoint is written in .Net Core using Bot Framework SDK. So I use their classes and also MicrosoftAppId and MicrosoftAppPassword is also sent to the endpoint (obligatory to use with Teams).
Thanks for clearing it for me.
You can see in the link that the limit only applies to premium channels. Your Teams bot should be fine.
I'm having really annoying problems getting my bot to work in MS Teams. I created it using Bot Framework v4 and deployed it to Azure. I deployed the bot using Direct Line from the "channels" blade and it's working ok. Then in the same blade I deployed it to MS Teams. And that caused issues.
People are telling me that the problem has to do with something about a manifest file and a "valid domains" setting I have to edit. I don't know what those are and I never had to do any of this when I told Azure to deploy it to MS Teams. It seems there's a whole different way to deploy the bot to teams, which is using App studio. I tried that way, and now I see another different issue.
So it doesn't work for me when I deploy with Azure or using App Studio. And I want to research and fix the issues, but first I need to know which method should I try to fix? Which am I supposed to use to deploy to MS Teams? Azure or App Studio?
Note: I'm not asking how to fix these issues. I want to know which method of deployment I am supposed to use. What's the difference?
Let's get the terminology straight first. You are building a bot. In Teams, a bot is just one of the possible capabilities of a Teams app. (The others are tabs, connectors, and messaging extensions.)
The definition of a Teams app is defined at a high level here.
Creating an app package (which is one of the things App Studio can do) is defined here - App Studio can also sideload/upload apps (see below).
Once you've created it, you need to make it available within Teams, first for yourself (and potentially others, if it's allowed in your tenant) via sideloading/uploading, or for your entire organization if you like. That's defined in Upload an app package, with in-depth discussion of the tenant app catalog here.