Using Azure AI Search as a Copilot Studio Generative Answers Knowledge Source

Azure AI Search is a powerful search engine that can be used to search for information in a large collection of documents. It can use any of the Azure OpenAI Models and can be used to search for information in a wide range of domains. In this article, we will show you how to use Azure AI Search as a Copilot Studio Knowledge Source for Generative Answers.

More information about this topic is found in the Copilot Studio Documentation

Table of Contents

Pre-requisites

To use Azure AI Search as a Copilot Studio Generative Answers Knowledge Source, you will need to have an Azure account. If you don't have an Azure account, you can create one for free at https://azure.microsoft.com/.

Create an Azure Open AI Service

Detailed instructions are here

NOTE You will need the Azure OpenAI Resource name and API key to connect Copilot Studio to Azure Open AI. You can find this information in the Azure portal under your Azure Open AI service.

Azure Open AI Resource Name
Azure Open AI Resource Name

Azure Open AI API Manage Keys
Azure Open AI API Manage Keys

Azure Open AI API Key
Azure Open AI API Key

Create an Azure Open AI Deployment

Detailed instructions are here

Deploy both a completion model (for example, gpt-35-turbo-16k) and an embedding model (for example, text-embedding-ada-002).

NOTE You will need the deployment names to connect Copilot Studio to Azure Open AI. You can find this information in the Azure OpenAI Studio portal or the Azure AI Studio portal portal under Deployments.

Create an Azure AI Search Service

Detailed instructions are here

NOTE You will need the endpoint URL and API key to connect Copilot Studio to Azure Open AI Search. You can find this information in the Azure portal under your Azure Open AI Search service.

Azure AI Search Endpoint URL
Azure AI Search Endpoint URL

Azure AI Search API Key
Azure AI Search API Key

NOTE The API Key must be one of the two main keys. A Query key will not work.

Detailed instructions are here

Once the index is created, you will see it listed in the Azure AI Search service indexes.

To connect Copilot Studio Generative Answers to Azure Open AI Search, follow these steps:

To connect Copilot Studio Generative Answers to Azure AI Search, you will need to create a connection in the Power Apps Portal. To do this, follow these steps:

  1. Go to the Power Apps Portal at https://make.powerapps.com/.
  2. Click on the "Connections" tab in the left-hand navigation pane.
    NOTE If you don't see the "Connections" tab, click on the "More" tab and then click on the "Connections" tab.
  3. Click on the "New connection" button.
  4. Search for "Azure OpenAI" in the search bar.
  5. Click on the "Azure OpenAI" connection.
  6. Click on the "Create" button.
  7. Enter your Azure OpenAI resource name and API key.
    NOTE: You can find your Azure OpenAI resource name and API key in the Azure portal under your Azure OpenAI Search service. See here.
  8. Enter your Azure Cognitive Search endpoint URL and API key.
    NOTE: This is the whole URL - You can find your Azure Cognitive Search endpoint URL and API key in the Azure portal 1nder your Azure Open AI Search service. See here.
    NOTE The API Key must be one of the two main keys. A Query key will not work.
  9. Click on the "Create" button.
  10. Once the connection is created, you will see it listed in the "Connections" tab.
    NOTE It's always a good idea to rename the connection to something more meaningful and descriptive to make it easier to find later in Copilot Studio.

Step 2: Connect a Generative Answers Knowledge Source

To connect a Generative Answers Knowledge Source to Azure AI Search, follow these steps:

  1. Go to the Copilot Studio portal at https://copilotstudio.microsoft.com/.
  2. Choose the appropriate environment from the drop-down list in the top right corner.
  3. Create a new copilot or open an existing one.
  4. Navigate to the "Conversation Boosting" topic.
  5. In the "Create generative answers" node, choose the ellipses in the top-right corner and select "Properties".
  6. In the "Properties" pane, expand the "Classic data" section.
  7. Navigate to the "Azure OpenAI Services on your data" section.
  8. Click on the "Add connection" button.
  9. Select the connection you created in Step 1.
  10. Click on the "Connection properties" button.
  11. Under the "General" tab, enter the following information:
  12. Under the "Model data" tab, click the "Add button" to add a data source and enter the following information (for an easy way to find these values, see below):
  13. Click on the "Save" button.

Finding the Connection Parameters

To easily find the raining connection parameters, follow these steps:

  1. Go to the Azure OpenAI Studio portal at https://oai.azure.com/.
  2. Click on the "Chat" button in the left hand navigation pane.
  3. Choose the completions deployment you created above.
  4. Click on the "Add your data" button and click the "Add a data source" button.
  5. Select "Azure Ai Search" as the data source and choose the Search service and Search index.
  6. Click the "Next" button.
  7. Leave the Search type as "Semantic" and select the semantic configuration from the dropdown.
  8. Click the "Next" button.
  9. Change the Authentication type to "API key"
  10. Click the "Next" button.
  11. Click the "Save and close" button.
  12. Click the "View code" button
  13. Choose a language from the dropdown and examine the code generated. All of the connection parameters are in the code. If you cannot quickly find one of the parameters, one of the other languages may make it more obvious.

Step 3: Test the Connection

To test the connection, follow these steps:

  1. In the "Copilot Studio UI" node, click on the "Test" button if the test pane is not visible"
  2. Ask a question that can be answered by your Azure AI Search data source.