Adding Azure Bot as a skill in Microsoft Copilot Studio (Power Virtual Agent)

Cloudatica
6 min readJan 26, 2024

--

Microsoft is putting more and more gas onto their Copilot Studio (formerly known as Power Virtual Agent)- a no code/ low code way to create chatbot with AI and Generative AI capability. So, all of our customers are now getting more interested in using Copilot Studio instead of Azure Bot Framework.

While Copilot Studio is steadily maturing, many of you might have a lot of pre-existing investments in Azure Bot Framework. Although many of the capabilities earlier possible only in Azure Bot Framework can now be implemented in Copilot Studio, you may not want to throw away prior work done in Azure Bot Framework.

Not throwing away prior work is the right business decision. Also, in some cases, Copilot Studio might also be missing some capabilities that needs extending your Copilot with Azure Bot Framework. If your scenario is something like this, this article should be useful for you.

This article provides step by step guide for extending Copilot Studio with Azure Bot Framework as a skill.

Here is a video version of this tutorial:

High level steps

Below are the high level steps:

  • Step 1- Make sure you have the right capabilities in your Azure Bot Framework code
  • Step 2- Create a manifest file for this skill and expose through an endpoint in your bot framework code (this manifest file has to be in the right format)
  • Step 3- Host this bot as a web service (this web service could be hosted anywhere, doesn’t have to be Azure)
  • Step 4- Register an app in Azure, put your manifest url as the homepage url. Use the App registration info in the .env file of your bot framework code (make sure this .env file is updated in your web service)
  • Step 5- In Copilot Studio, add a skill by providing the manifest url
  • Step 6- Once this skill is successfully added, it’s ready to be used in your Copilot as an Action

Detailed Instructions

Step 1- Make sure you have the right capabilities in your Azure Bot Framework code

This article will not go into the details of Azure Bot Framework. Having right capability in your Bot Framework means having an activity handler that handles the event. For example, following code shows that this bot handles events like “BookFlight” , “GetWeather”. (full code of this tutorial is available for premium subscribers of Cloudatica. If interested, please reach out to us at hello@cloudatica.com.):

In the sample code I provided, beginGetWeather has a dummy implementation for testing:

Step 2- Create a manifest file for this skill and expose through an endpoint in your bot framework code (this manifest file has to be in the right format)

Have a manifest file like below. Make sure it’s in the right format and modified to have the right Azure App registration info (App registration is a later step).

Make sure you have a url in your web service for this manifest file. In my nodejs code, below is the snippet for this:

Step 3- Host this bot as a web service (this web service could be hosted anywhere, doesn’t have to be Azure)

Host this service somewhere so that it’s accessible via internet. Azure and Copilot need to have a way to get to this web service. Azure provides an easy way to host web service. However you can host this web service anywhere.

For my testing, I just ran this on my localhost and used ngrok utility to provide a tunneling so that we get a url that is accessible via internet. This is a good way to quickly test but of course not good for production setting.

Note- While you can start small for deploying this web service, as your usage scales, you have to make sure your web service resources scale to continue providing great user experience to your users. That needs good attention to monitoring and managing your web service. You can either do it yourself or take advantage of a fully managed service by Cloudatica to host, monitor, and manage this web service. If you don’t want to spend your energy and resources in deploying, monitoring, and managing this web service, please reach out to us at hello@cloudatica.com. We’ll take care of this headache and free up your time and resource for more higher priority things.

Anyway, for my case, I got following ngrok url https://ead9-2607-fb10-7231-1-00-3c2.ngrok-free.app

I’ll use this for endpoint url, Azure Bot setting etc.

Optionally, you can also test your bot using emulator and/or Azure Bot web chat.

Step 4- Register an app in Azure, put this manifest url as the homepage url. Use the App registration info in the .env file of your bot framework code

For App registration, just create an app during Azure App registration.

In the app registration, make sure that homepage url under Proerties and Branding is the same as the manifest url:

Update the info from this app into the .env file of your Bot Framework project (.env file in nodejs project. For .NET, it’s appsettings file). I put allowed callers as * so that any caller can call it. If you want to restrict that, put the Copilot Bot id that you want to call from.

Step 5- In Copilot Studio, add a skill by providing the manifest url

In Copilot Studio, go to Settings -> Skill and then click on “Add Skill”. You’ll be asked to provide Manifest url. Provide that url of the json file (See previous steps):

Step 6- Once this skill is successfully added, it’s ready to be used in your Copilot as an Action

If you followed all the instructions properly and created the manifest file correctly, you will see a message like above “Your skill has been validated. You may now save.”

Once you Save it, you can go to any Topic and click on “Select anAction”. You’ll see this Skill listed as an action. For example, “skillbot” in the picture below

Once you select, you are ready to use it as below:

That’s it. Hope you found this article useful. Leave your your questions/ feedback as comment below. If you are looking for consulting, training, or coaching on Microsoft AI Stack, Copilot, Azure, or Power Platform, please reach out to us at hello@cloudatica.com

Please reach out to us at hello@cloudatica.com if you need help with any of the following:

  • Access to full code for this tutorial by being a premium subscriber
  • Getting this implemented in your organization or for your customer
  • Fully managed Azure Bot Framework web service — including Deployment, monitoring, and ongoing management
  • Trainings on topics like these

--

--

Cloudatica
Cloudatica

Written by Cloudatica

Team of experts in Microsoft AI Stack (Copilot) and Power Platform. For consulting or training, reach out to us at hello@cloudatica.com