Enable multi-tenant bots
Bot service is something that more than one of our customers has expressed interest in, but we don't want to have to deploy a new Bot instance for every one of them. Please add multi-tenant capabilities to ABS so we can detect the bot name that received the request and use the same back-end code across multiple endpoints.
@Graham, I would like to clarify the ask. Are you looking to create a single bot (with the same functionality) that can serve multiple ‘different’ (for lack of better term) companies/ groups? Can you clarify if all groups are on the same channel? Will each group use a different bot name as part of their intents? Please provide additional details for your scenario.
Dean Goddette commented
This is exactly the issue that I am trying to deal with. I have a single chatbot that can be used for 1000 different customers. There is some customization in the response strings but otherwise, it's the same business logic for all the customers. If possible, I am planning one multi-tenant bot to serve all the 1000 customers while only changing string resource files, say.
Adrian Frischkorn commented
Is there any update on this? Currently the only option I see is deploying multiple bots (app registration, web app, app service plan, etc...) or handle multi tenancy in the bot itself after login or something. The later makes more sense to me now.
Rodrigo Rodriguez commented
We have developed a Bot Platform called General Bots (https://github.com/pragmatismo-io/BotServer) based on BOT Framework v4 which implements a server serving the same back-end code across multiple endpoints. Take a look at this picture:
https://raw.githubusercontent.com/pragmatismo-io/BotServer/master/docs/images/general-bots-stack.png and checkout a sample package that can be shared across bot instances: https://github.com/pragmatismo-io/AzureADPasswordReset.gbapp. A .gbapp can be created one for each customer or use case and be shared among bots on the same server. Other packages as well can be created and you architect the bot tree the way you would like to.
Mark Broomfield commented
I too am looking to implement this scenario. Are there any recommended solutions?
Graham Hunter commented
Yes, that's exactly it. Take a corporate directory bot for example (not our real product). If "Tasty Juice Company" signs up for our service they will want the bot to have their own identity for their end users, set up security accordingly, and not allow a different customer of ours, say "Yummy Smoothie, Inc." to have access to the TJC directory and will be on a separate channel.
This is accomplished in Azure Web Apps by setting up custom domains, and in the server code we can detect the hostname of the incoming request and segment the tenant accordingly.
The keys to this would be in setup (something we can automate for new customers), single codebase (everyone runs on the same code), and simplicity of deployment (we don't want 1000 bots for 1000 customers).
Does that make sense?