microsoft / BotBuilder-Samples

Welcome to the Bot Framework samples repository. Here you will find task-focused samples in C#, JavaScript/TypeScript, and Python to help you get started with the Bot Framework SDK!
https://github.com/Microsoft/botframework
MIT License
4.36k stars 4.87k forks source link

Sample bot for deploying in Azure function using http trigger #3016

Open wonboyn opened 3 years ago

wonboyn commented 3 years ago

Is your feature request related to a problem? Please describe. I'm interested in deploying bots as functions rather than as a web app. I've not been able to find an up to date examples/tutorial on what needs to be done to trigger the required botframework adapter/controller etc from an Azure function HTTP trigger.

Describe the solution you'd like A sample dotnet core bot (eg echo bot) based on v4 of the botframework sdk that can be deployed as an Azure function using the http trigger

Describe alternatives you've considered I've found a couple of examples (eg this & this) but they are incomplete or refer to older versions of the botframework sdk

wilsoncg commented 3 years ago

+1 Yes please, I'd like to see a sample too. The closest I have found is this, however it uses AuthorizationLevel.Anonymous & BotFrameworkAdapter using an alpha version of the SDK, but I'd like to see samples using AuthorizationLevel.Function which according to this comment, all auth scenarios are fully supported.

wilsoncg commented 3 years ago

@wonboyn after a lot of fiddling around, I have a working bot written in C# (dotnetcoreapp3.1). It's running as an Azure function (consumption model), with an HTTP trigger, using BotFramework SDK v4. It's also connected to LUIS and twitter API.

https://github.com/wilsoncg/bot Feel free to have a look and use as a reference.

wonboyn commented 3 years ago

@wilsoncg - Thanks for that. I'll check it out.