Connect to Azure OpenAI from Power Automate

This post will show how to connect to Azure OpenAI from Power Automate.

Azure OpenAI, a suite of powerful AI models, offers robust solutions for diverse AI needs. Integrating it with Power Automate allows users to automate complex tasks with AI.

Power Automate is a service that helps create automated workflows between apps. It streamlines repetitive tasks, ensuring efficient and error-free operations. Here, we’ll leverage it with Azure OpenAI to enhance workflow automation.

Create Azure OpenAI Resource

Begin by setting up an Azure OpenAI resource in your Azure portal. This resource will host the AI models you choose to deploy. Please visit the posts below for more details:

Copy Key

Once your resource is created, navigate to the ‘Keys and Endpoint’ section. Copy the key provided; you’ll need it for authentication in the steps that follow.

Create a Power Automate Flow

Create a new flow in Power Automate. This flow will be the foundation of your automation, dictating how data is processed and when.

Step 4 – Add HTTP Action

In your flow, add an HTTP action. This allows your flow to communicate with Azure OpenAI by sending HTTP requests.

Configuration

Configure the HTTP action with the following settings:

  • URL:
    https://[OpenAI Resource Name].openai.azure.com/openai/deployments/{Deployment Name}/chat/completions?api-version=2024-02-15-preview
  • Method: POST
  • Headers:
    Content-Type: application/json
    api-key: [Your API Key Here]
  • Body:
  {
    "messages": [
      {
        "role": "system",
        "content": "You are an AI assistant that helps people find information."
      },
      {
        "role": "user",
        "content": "Hello"
      }
    ]
  }

This setup allows your Power Automate flow to interact with Azure OpenAI, sending and receiving data as specified. By following these steps, you’ve successfully connected Azure OpenAI with Power Automate to automate tasks using AI.

Processing…
Success! You're on the list.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.