How to set up Copilot Studio with OpenAI and integration with Sharepoint online

One of the new services that was released last week during Microsoft Ignite was Copilot Studio. Studio is a “rebranding” of Power App Virtual Agent. It is a low-code platform designed for tailoring Copilot for Microsoft 365 and creating independent copilots. This platform integrates various advanced conversational features, including specialized GPT models, generative AI add-ons, and manually curated topics.

The service is available in preview now (here –> Microsoft Copilot Studio | Extend Copilots or Create Your Own)

While the name of the service is named “Copilot” it is not directly related to Microsoft 365 Copilot, but I will get back to that. Since this is a bot, you have predefined topics that the bot can be asked about. You can think of this as “keywords” so that if you ask the bot something it has a set of predefined topics that it can reply to. What about if you ask it something it doesn’t know anything about? That is where Generative AI comes in.

Firstly we create a new “Copilot”.

Once the bot is created, you also have an option called “Generative AI”, where we need to enable the AI feature. This allows the bot to use Azure OpenAI to answer questions about topics that it does not know anything about.

Once the feature is enabled you will get new “topics” for unknown intent. The feature can also use different data sources to answer questions, such as

  • Public websites
  • Azure AI Search
  • Custom uploaded data
  • SharePoint / OneDrive

But let us set up a topic that will answer questions related to information stored on SharePoint.

Now we have a new topic called Conversational boosting for unknown intent. This means answering questions related to topics it knows nothing about. So when you open the topic we have some different options.

When you go into the properties of the topic, and into data sources you have the option to define different data sources, so here I’ve added a SharePoint site. Here I can add one or multiple sharepoint sites.

Now I want to set up a demo site that will be used to access Sharepoint site in context of my user access, to make this work I will need to add authentication to the bot, so it can get an access token on behalf of my user. To set up authentication for this bot go into Settings –> Security –> Authentication. Now here you have some options depending on if you want to publish the bot on a custom website or if it will only be published in Teams / Power Apps. If you choose custom website you need to define a custom scope on the bottom.

Secondly you need to define Graph scopes on the Entra ID application, so that it can access the sharepoint site using the scope

Once this set up and authentication is configured, you can publish the bot to a demo website.

When I talk now with the bot I can reference the SharePoint content. This uses Graph Search underneath to find the content as seen here, when I ask a question that is part of a document stored in SharePoint

From Copilot Studio we can also customize the way Microsoft 365 Copilot works with Conversational plugins and AI plugins. This allows us to create custom actions (think about this as GPT Functions) but this allows us to use for instance Microsoft Flow actions to trigger directly and can then be made available trough Microsoft 365 Copilot. Stay tuned for a future blog post on that!

Leave a Reply

Scroll to Top