Azure bot as skill to PVA
Wondering what to choose Azure bot or PVA
You might be wondering whether to create an Azure Bot or use Power Virtual Agents (PVA). Which one is best for your needs? What should you choose? The article below will help you make an informed decision.
https://techcommunity.microsoft.com/t5/iis-support-blog/pva-and-azure-bot/ba-p/4208047
Let’s say you decide to use Power Virtual Agents (PVA) instead of an Azure Bot. But what happens if you already have an Azure Bot? Migration? Yes, but that will take time.
So, can we leverage PVA features while the migration is happening in the background? Absolutely! This article will guide you on how to use PVA alongside your existing Azure Bot.
Step 1: Identify Your SDK V4 Bot and convert to skill
Ensure you have an SDK V4 bot ready and that is working as expected.
We are going to add the same bot selected here as a skill to your newly created PVA bot
Open Your Bot Project:
Open the project that contains the bot you want to convert into a skill.
Export as a Skill:
In the Bot Framework Composer, go to the Create page.
In the bot explorer, find your bot and select the more options (…) menu.
Choose Export as a skill from the menu.
Describe Your Skill:
On the Export your skill page, provide the necessary details such as the skill name, version, publisher name, and a description.
Select Dialogs and Triggers:
Choose the dialogs that will be accessible to consumer bots.
Select the triggers that can start a task. By default, new skill manifests include an event activity as the initial activity sent by a root bot to the skill.
Generate and Publish the Skill Manifest:
Composer will create a skill manifest that describes your skill.
Publish your bot to Azure along with the skill manifest.
Step 2: Update Bot Configuration
Add Allowed Callers: Update your bot’s appsettings.json file to include the PVA bot’s ID in the AllowedCallers section.
{
“MicrosoftAppId”: “<your bot’s app ID>”,
“MicrosoftAppPassword”: “<your bot’s app password>”,
“AllowedCallers”: [ “<PVA bot ID>” ]
}
Step 3: Create a Skill Manifest
Generate Manifest: Create a skill manifest file (manifest.json) for your bot. This file describes the actions your bot can perform and how it can be invoked.
JSON
{
“name”: “YourSkillName”,
“description”: “Description of your skill”,
“msaAppId”: “<your bot’s app ID>”,
“endpoint”: “https://<your bot’s endpoint>/api/messages”,
“actions”: [
{
“id”: “YourActionId”,
“definition”: {
“triggers”: [
{
“type”: “event”,
“name”: “YourEventName”
}
],
“inputs”: [],
“outputs”: []
}
}
]
}
Step 4: Verify your keys in Azure
Azure AD Registration: Ensure your bot is registered in Azure Intra ID. The bot’s application ID and password should match those in your appsettings.json.
Step 5: Create your PVA and Add the Skill to Power Virtual Agents
Create PVA
https://azure.microsoft.com/en-in/products/power-virtual-agents
Open PVA: Go to the Power Virtual Agents portal.
Manage Skills: Navigate to the “Manage Skills” section.
Add Skill: Click on “Add a skill” and provide the URL to your skill manifest file.
Validate and Save: PVA will validate the manifest. If everything is correct, save the skill.
Step 6: Test the Integration
Invoke Skill: Create a topic in PVA that triggers the skill. Test the integration to ensure that the skill is invoked correctly and responds as expected.
Additional Resources
Implement a Skill for Power Virtual Agents
Bot Framework Skills Documentation
Microsoft Tech Community – Latest Blogs –Read More