Azure bot as skill to PVA

  • Thread starter Thread starter meenakshiBalekar
  • Start date Start date
M

meenakshiBalekar

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.

PVA and Azure bot



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




  1. Open Your Bot Project:
    • Open the project that contains the bot you want to convert into a skill.

  2. 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.

      botImage.png



  3. Describe Your Skill:
    • On the Export your skill page, provide the necessary details such as the skill name, version, publisher name, and a description.

  4. 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.

  5. 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

  1. Add Allowed Callers: Update your bot’s appsettings.json file to include the PVA bot’s ID in the AllowedCallers section.

Code:
{
  "MicrosoftAppId": "<your bot's app ID>",
  "MicrosoftAppPassword": "<your bot's app password>",
  "AllowedCallers": [ "<PVA bot ID>" ]
}



Step 3: Create a Skill Manifest

  1. 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

Code:
{
  "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

  1. 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

  1. Create PVA
    Microsoft Copilot Studio | Microsoft Azure
  2. Open PVA: Go to the Power Virtual Agents portal.
  3. Manage Skills: Navigate to the “Manage Skills” section.
  4. Add Skill: Click on “Add a skill” and provide the URL to your skill manifest file.
  5. Validate and Save: PVA will validate the manifest. If everything is correct, save the skill.

Step 6: Test the Integration

  1. 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


Continue reading...
 
Back
Top