Please clarify steps required to connect a non-Azure hosted (botkit) bot to bot framework's webchat

PatriciaG 21 Reputation points
2022-02-04T17:30:09.62+00:00

I have already attempted to do this connection on my own but I've been unable to get this working (please see my post on Stack Overflow at https://stackoverflow.com/questions/70901441/unable-to-connect-botkit-based-bot-to-botframeworks-webchat-401-errors) It would be very helpful if some Microsoft Expert clarified the following:

  • Can a non-Azure (botkit) bot that integrates with the bot framework via https://github.com/howdyai/botkit/blob/main/packages/docs/core.md#using-bot-framework-channels , connect with Bot Framework's web chat?
  • If so, what are the required steps? Are these exactly the same steps as those described in the documentation at: https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-connect-webchat?view=azure-bot-service-4.0? Please ensure that your answer applies to this particular type of bot, as I have not used the Bot Framework's tools to create my bot - most answers are provided for bots created with these tools and also hosted on the Azure cloud (the only thing I have created on Azure is an AzureBot resource for my bot via the Azure console (single tenant), which I configured with my external messaging endpoint - details are on my Stack Overflow post).
  • If the required steps happen to be the same as in the docs above, and you are able to help figure out why the connection is not working for me, I'd appreciate your answer either here or on that Stack Overflow post.
    Thanks in advance.
Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
945 questions
{count} votes

Accepted answer
  1. Steven Kanberg 86 Reputation points
    2022-04-18T21:23:28.09+00:00

    @PatriciaG , I followed the instructions listed here for creating a BotKit bot and chose the BotFramework implementation. With an Azure resource setup + ngrok for tunneling between ABS and the locally running BotKit bot, I was able to connect Web Chat to my bot. You just need to enable the DirectLine channel in your ABS bot's channels blade and use the DirectLine secret for connecting Web Chat. (Please be sure to not use the secret in your Web Chat code in a production setting.)

    Following the above worked flawlessly. Please note that I created the Azure bot as a 'MultiTenant' bot.

    I then did the same using a 'SingleTenant' bot and received a 401 unauthorized error.

    I believe this occurs because single tenant bots aren't fully supported, just yet. As far as the BotFramework is concerned, a BotFramework bot that uses the older BotFrameworkAdapter should work without issue. However, a bot that uses the newer CloudAdapter has an issue when the app type is SingleTenant. This should be fixed with the next release, v4.16.

    However, you are using BotKit and I am unsure what adapter it is utilizing under the hood for connecting to the BotFramework. Regardless, it doesn't appear to support 'SingleTenant' bots, at this time.

    You will need to create an ABS bot that is of the 'MultiTenant' app type for your bot to connect until BotKit is updated to support the other options.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.