How to deploy botbuilder sample as Azure Function - botframework

I'd like to deploy one of the dotnetcore botbuilder samples as an Azure function and point the bot service registration at the Azure function.
I've found a few posts that describe this sort of thing but they seem to refer to v3 of the SDK.
Is this possible with the v4 SDK? If so, is there a sample that demonstrates this or can you provide guidance on what changes are required to the project/code to achieve this?

Related

Teams Bot - get credentials from Key Vault

I have searched a bit but didn't found something which is helping me. I created a bot for teams and like described in all examples I am using the appsettings.json to store the ID and the password for the bot (MicrosoftAppId and MicrosoftAppPassword). These are both handled by the framework somehow. But now I want to use an Azure Key Vault to store the secret instead of having the appsettings file.
So I found some examples explaining how to do this in BotFramework V3 with BotAuthentication Attribute and even something for BotFramework V4 here (working link for the linked example here). But even that example is old and does not exist anymore like that.
How am I supposed to do this for a teams bot and c# dotnet 3.1?
You can use the following method to store the secret value
var storageSecretValue = keyVaultClient.GetSecretAsync($"{this.configuration.GetSection("KeyVault")["BaseURL"]}{this.configuration["KeyVaultStrings:StorageConnection"]}");
please refer the following sample document to more clarification:-
https://github.com/OfficeDev/microsoft-teams-apps-newemployeeonboarding/blob/main/Source/Microsoft.Teams.Apps.NewHireOnboarding/Startup.cs
https://learn.microsoft.com/en-us/samples/azure-samples/key-vault-dotnet-core-quickstart/get-started-keyvault-net/

How to convert a V4 bot to a Skill?

We are planning to add existing bot which is V4 to our Universal Bot which is in Virtual Assistant template.
For this we have come up with the Skill based approach via which we can add skills to existing VA.
The challenge which we are facing now is that we couldn't find link which was there earlier to convert existing V4 bot to skill (https://microsoft.github.io/botframework-solutions/skills/tutorials/convert-v4-bot/csharp/2-add-packages/).
and the link which there in FAQ section(https://microsoft.github.io/botframework-solutions/help/faq/ ) under "How do I convert an existing v4 Bot to a Bot Framework Skill?" redirects me to a Microsoft page implementing a skill (https://learn.microsoft.com/en-us/azure/bot-service/skill-implement-skill?view=azure-bot-service-4.0&tabs=cs)
The current document has section of migrating Virtual Assistant to Bot framework Skill(Migrate existing Virtual Assistant to Bot Framework Skills GA).
but I cannot find any page in updated document which can guide me to convert existing V4 Bot to skill.
Please help us with the same.
Looks like your problem is solved on GitHub in this issue. For others with a similar issue, here is the explanation.
The link https://learn.microsoft.com/en-us/azure/bot-service/skill-implement-skill?view=azure-bot-service-4.0&tabs=cs described how to implement a skill. If your bot is based on the BotBuilder SDK greater than or equals to 4.7.0, then your bot is automatically a skill. Virtual Assistant that's created based on the Virtual Assistant Template that's greater than or equals to the 0.7 release will be able to connect to a skill without extra work.
Hope this helps.

Can't Migrate New Bot From BotFramework

Recently setup a new bot in BotFrameWork.
Setup a App Registration and Function bot to work with Teams bot integration.
However after trying to migrate the bot it gives error everytime.
I have even tried recreating a bot with same info.
I have triple checked the app ID ect..
Anyone have a recommendation?
Error Message
The migration process requires an active Azure account / subscription. The email account connected to your Azure account must be an admin/owner of the bot for the migration to succeed.
From the migration documentation:
Before migrating a Functions bot created with Node.js, it is required that you use Azure Functions Pack to package the node_modules modules together. Doing so will improve performance during migration and execution of the Functions bot after it is migrated. To package your modules, see Package a Functions bot with Funcpack.
Also, note that Functions bot have not supported since Bot Framework SDK v4. It is recommended you create a Web App Bot instead, which supports the SDK v4.
Hope this helps.

Botframework v4 on Functions

I'm trying to figure out if I can run botframework v4 on Azure functions. Current azure functions page shows only v3 sdk.
Anyone has any idea if we can run v4 on functions or not?
Thanks.
According to Azure portal,
Bot Framework SDK v4 is now available and comes with many updates and new functionality. Function Bots are based on SDK v3; we recommend you create a Web App Bot instead, which supports the new SDK v4.
You can set up a functions bot, but only with the v3 SDK. AFAIK, there are no plans to support functions bots in v4.

LUIS Dispatch Bot sdk V3 support?

Is it possible to create LUIS Dispatch for existing V3 Bot ? We have v3 bot that's in production and we have gone so far now so its difficult to switch over v4 Bot. However, there are awesome capabilities like LUIS dispatch tool that we would like to leverage.
Ref:-
https://learn.microsoft.com/en-us/azure/bot-service/bot-builder-tutorial-dispatch?view=azure-bot-service-4.0&tabs=jsaddref%2Cjsbotconfig#integrate-multiple-luis-apps-and-qna-services-with-the-dispatch-tool
Given the fact that the source code is available for the LUIS components and the provided examples, I think you can use this tool on v3 bot after some modifications.
It looks like the dispatch tool is only preparing a custom LUIS app that you will query from your bot, so nothing really linked to v4 of bot builder.

Resources