microsoftgraph / microsoft-graph-comms-samples

Microsoft Graph Communications Samples
MIT License
206 stars 222 forks source link

Question: Sample for Local Media bot hosted as WebApp? #277

Open InDieTasten opened 4 years ago

InDieTasten commented 4 years ago

The current samples only include deployment strategies for Service Fabric or classic Cloud Apps.

Service Fabric involves quite a large compute environment, with production clusters being at least 5 VMs.

To start small and to do some testing, it would be great to have the ability to deploy bots as web apps. They could even be deployed into the Azure Bot Service, as that's basically just an additional managed service on top of a web app resource as far as I understand.

I've been trying to adjust some of the samples myself to be deployed as ASP.NET applications, but I'm running into a lot of assembly loading problems revolving around Microsoft.Rtc.Internal.Media and have not found a way around it. I'm used to .NET Core and being able to easily pull in dependencies with Nuget. All the assembly binding crap in .NET Framework is a bit out of my comfort zone.

Before I invest more time, is there a reason why the local media bot samples still use the ancient classic cloud apps for deployment? Is there a limitation in Web Apps that will ultimately set me up for failure attempting to do this?

adityaramgopal commented 4 years ago

We currently don't support .NET Core because the library has other dependencies which are not compatible with .NET Core. We plan to eventually support .NET Core but we don't yet have a date. Currently the best option for local media bots is to use Classic Cloud Service or Service Fabric.

This page describes the requirements for running local media (Application-hosted media bots): https://docs.microsoft.com/en-us/microsoftteams/platform/bots/calls-and-meetings/requirements-considerations-application-hosted-media-bots

InDieTasten commented 4 years ago

I'm not planning to use .NET Core. I AM trying to use ASP.NET with .NET Framework, hosted via IIS. The IIS seems to be the main problem, but I can't figure it out.

Therefor, it would be great to have some hints as to how to consume the Skype.Bots.Media packages (mainly MediaPerf) with an application hosted via IIS. MediaPerf seems to be the main issue preventing the rest to load properly

adityaramgopal commented 4 years ago

Did you run the MediaPlatformStartupScript.bat under elevated privileges at the start?

InDieTasten commented 4 years ago

I'm not sure where that bat file would be located. I've not run this script knowingly or manually.

I was able to run local media bots though, as long as I don't run them as part of an IIS Express process. So vcredist are not the problem, if that's what the script would do install. the vc++ redistributables are all installed and up to date on my machine.

adityaramgopal commented 4 years ago

It should be in the Microsoft.Skype.Bots.Media nuget. Try running that during process start and see if the issue goes away.

InDieTasten commented 4 years ago

Okay, I found the file in the output directory under the "skype_media_lib" folder.

I ran ./MediaPlatformStartupScript.bat as administrator and it seems to have resolved the issue.

Thank you very much for your help with that issue.


Sadly, this entire issue got a little bit side-tracked, as it's all about my assembly loading issues, even though the title suggests it's about an additional sample deployable to an Azure WebApp resource.

So my main question is still open for comments:

Are there any hard limitations on Azure Web App Services, that would prevent running an Application-Hosted Media Bot in there? E.g. Would running the MediaPlatformStartupScript be required? If so, would it be possible to run it with elevated privileges?

cloudsung97 commented 4 years ago

Hi, @InDieTasten I have the same requirement. Have you found the way to make it work on web app?

InDieTasten commented 4 years ago

@cloudsung97 No, we are now running a service fabric cluster sadly.