06-02-2024 20:17 PM
Hi there,
This cookbook will guide you through the process of integrating Azure OpenAI with Copilot Studio. By following these steps, you will be able to harness the power of Azure OpenAI's language models within Copilot Studio for enhanced capabilities.
Prerequisites
Step-by-Step Instructions
Step 1: Set Up Azure OpenAI Service
1. Log in to the Azure Portal
- Navigate to Azure Portal - https://portal.azure.com
2. Create an OpenAI Service Resource
- In the Azure Portal, click on "Create a resource" and search for "Azure OpenAI".
- Click on "Azure OpenAI Service" and then "Create".
- Fill in the required details:
- Subscription: Select your subscription.
- Resource Group: Create a new resource group or select an existing one.
- Region: Choose the region where you want the service to be deployed.
- Name: Provide a unique name for your OpenAI service.
- Pricing Tier: Select the pricing tier that suits your needs.
- Click "Review + create" and then "Create".
3. Generate the OpenAI connection
- Once the OpenAI service is deployed, navigate to the https://oai.azure.com
- Go to the "Deployments" section on the left menu
- Create a new deployment and name it. i.e. gpt-4o
- Wait 5 minutes or so to have your deployment ready for use
- Go to the "Chat" section on the left menu
- Select the model on the right panel
- Click on the "View Code" button, above the chat (playground)
Step 2: Set Up Copilot Studio
1. Log in to Copilot Studio
- Navigate to Copilot Studio - https://copilotstudio.microsoft.com
2. Create a new Copilot
- Click on "Create" and provide a name, description, instructions (for Generative AI), language, and knowledge source (if you have any data source for Generative AI).
- Or you could choose an existing template from Microsoft
3. Integrate with Azure OpenAI
- In your copilot chatbot, go to the "Topics" tab
- Select an existing topic (we often use the "Conversational boosting" topic for Azure OpenAI integration) or build a new one
- If you don't have the "Create generative answers" action in your topic, follow the steps below:
- Add a node
- Advanced >> Generative answers
- Add the input from the user message by using the "Activity.Text" variable
- Edit your data source from "Create generative answers" action
- Go to Classic data
- Add a connection
- Click on the "Manage connections in Power Apps"
- Add a new connection and search for "Azure OpenAI"
- The following properties will be filled by using the info from Step 1 (Azure OpenAI in Azure portal)
- Fill in the "Azure OpenAI resource name" property - with the same name for your Azure resource group
- Fill in the "Azure OpenAI API key" property - with the information on the "View code" called "Key"
- Fill in the "Azure Cognitive Search endpoint URL" property - with the information on the "View code" called "URL"
- Then create your connection
- Go back to the Copilot Studio and add your connection to the Classic data
- Fill in the connection properties using the information provided on Step 1 from oai.azure.com portal
e.g. Deployment "gpt-4o", API version "2024-02-15-preview"
- Save your topic
Step 3: Test the chatbot
- Run the task and test the responses.
Conclusion
By following these steps, you will successfully integrate Azure OpenAI with Copilot Studio, enabling advanced AI capabilities in your projects. Use this integration to enhance your workflows, automate tasks, and provide better insights.
For more detailed guidance, refer to the official documentation of Microsoft Learn or join our free community called "Romão's Learn"
1. Microsoft Learn link - https://learn.microsoft.com/en-us/microsoft-copilot-studio/nlu-generative-answers-azure-openai?WT.mc...
2. Romão's Learn link - https://romaos.com.br/learn
Regards,
Renato Romão - https://www.linkedin.com/in/renatoromao/
@renatoromao Hello, thank you for sharing. I am currently using gpt-4o to answer the question you provided. The question is do I need to build an Azure AI search service, or can I just build a gpt-4o model? In addition, after the settings are completed, how do you know which model Copilot Studio uses to answer the actual test? Because the current actual test feels that it still uses the built-in model to answer questions.