Power Automate  

How to Use GPT with Power Automate via Azure OpenAI

Hello developers!

These days, AI is everywhere, helping us write emails, fix code, and even automate workflows. One of the powerful tools behind this AI revolution is OpenAI’s GPT models, like the one you know as ChatGPT.

But here’s a common confusion that many beginners ask me,

“If ChatGPT is already working so well, why do we need Azure OpenAI?”

“And how can I use it in Power Automate to build smart flows?”

In this article, let’s break it down in simple terms. I’ll explain what Azure OpenAI is, why we use it, and then how to connect it with Power Automate to build powerful automations — even if you’re just starting your career.

What Is Azure OpenAI?

Let’s start from the basics.

Azure OpenAI Service is Microsoft’s way of giving us access to powerful AI models like GPT-4, GPT-3.5, Codex, and more — but with enterprise-grade security and control.

Imagine it like this: You already know ChatGPT (chat.openai.com) — it’s great for casual use. But for businesses, we need more control, security, and custom integration. That’s where Azure OpenAI comes in.

With Azure OpenAI, you get,

  • Private and secure deployment of GPT models
  • Controlled API usage with monitoring and scaling
  • Better compliance with the company's needs
  • Integration with Microsoft Power Platform tools

So basically, it’s ChatGPT… but business-ready.

Why Use Azure OpenAI Instead of OpenAI Directly?

Good question! As developers, we always look for the shortest path. So naturally, you may think — “Why not just call OpenAI’s own API directly in Power Automate?”

Here’s the key difference

Feature OpenAI API (chat.openai.com) Azure OpenAI (via Microsoft)
Free/Paid account Personal Business/Enterprise
Data security Less control High security (Azure standards)
Easy Power Platform integration ❌ Not native ✅ Seamless with Power Automate
Regional compliance Depends on OpenAI Controlled in your Azure region
SLA and support Community only Enterprise support via Azure

If you're just experimenting, the OpenAI API is fine. But if you're building serious business apps, Azure OpenAI is the way to go.

How to use Azure OpenAI GPT Models in Power Automate?

Now, let’s move to the hands-on part. You’ll be surprised how easily you can plug GPT into your flows using Power Automate.

Step 1. Set Up Azure OpenAI Resource.

  1. Go to https://portal.azure.com
    Azure OpenAI Resource
  2. Create a new Azure OpenAI resource.
    Azure OpenAI
  3. Choose your region (like East US or West Europe)
    Choose your region
  4. Click next,
    Review
  5. Click create, and then the deployment will start to create an Azure Open AI resource.
    Azure
  6. The Resource has been created successfully.
    Created
  7. Once deployed, go to Keys and Endpoints.
    Endpoints
  8. Note down your.
    • Endpoint URL
    • API Key

Also, ensure GPT-3.5 or GPT-4 deployment is done in the “Deployments” section.

Step 2. Launch Azure OpenAI Studio.

Now we need to set up and test our GPT model.

  1. Go to the Azure portal.
  2. Select the Azure OpenAI resource you just created.
    Portal
  3. This opens the Azure OpenAI Studio, your playground for testing GPT models.
    GPT models
  4. Then click Azure AI Foundry (earlier OpenAI Studio),
     Azure AI Foundry

Step 3. Deploy a GPT Model.

You must deploy a model before using it.

  1. In the Studio, go to the Deployments tab.
  2. Click + Create new deployment.
    Deployement
  3. Choose a model like gpt-35-turbo or gpt-4.
    MOdels
  4. Give it a name like gpt35-deployment and hit Deploy.
    Deploy

Step 4. Test the Deployment in Chat Playground.

Now, before you bring it to Power Automate, let’s test it.

  1. In Azure OpenAI Studio, go to the Chat playground
  2. On the top left, choose the deployment you just created
  3. Set a System message like,

“You are an expert assistant who helps explain technical things simply.

Chat Playground

Try chatting — enter a sample message like,

“Explain what Power Automate is in 2 lines.”

Power Automate

You’ll see GPT replying in real time!

This helps you fine-tune how your assistant behaves — super helpful when integrating with real workflows.

Step 5. Create a Power Automate Flow.

  1. Go to https://make.powerautomate.com
  2. Click Create > Instant Cloud Flow
  3. Choose a trigger (like “Manually trigger a flow”)

Creating an input variable to pass the text,

Flow

Add an action → HTTP connector.

Configure it like this,

  • Method: POST
  • URI: copy it from Azure AI Foundry here.
    Turbo
  • Headers
    • Content-Type: application/json
    • api-key: <Your API Key>
  • Body
{
  "messages": [
    {
      "role": "system",
      "content": "You are an emotion detection assistant. Your task is to read the user's message and identify their emotional tone. Only reply with one word such as: Happy, Sad, Angry, Excited, Confused, Neutral, or Anxious."
    },
    {
      "role": "user",
      "content": "@{variables('Usertext')}"
    }
  ],
  "temperature": 0.7
}

Http

Step 6. Use the Response in Your Flow.

You can now use the GPT model’s response in further actions like,

  • Send an email using Outlook
  • Post to Teams
  • Save it to SharePoint
  • Add it to Excel

This allows your Power Automate flow to “think” and generate smart content automatically!

We can verify the results like this,

Response

Real-Life Example: AI-Based Email Reply Generator

Let’s say you want to build a flow that reads a customer support message and automatically drafts a polite email reply using GPT-4.

Just pass the message into the Azure OpenAI prompt, and get the reply text in return.

No more hardcoding replies — let AI handle it.

Final Thoughts For Beginners

If you are new to AI + Power Platform, don’t worry. You don’t need to be a data scientist or a hardcore coder. Microsoft has made it super easy with:

  • Power Automate
  • Azure OpenAI
  • Low-code integration

You just need API basics, some JSON, and creativity.

And remember, this is just the beginning — from intelligent approvals to smart document generation, the combo of Power Automate + Azure OpenAI is going to change how we build apps.

Wrapping Up

In this blog, we explored,

  • What is Azure OpenAI, and how does it differ from public OpenAI
  • Why enterprises prefer it for secure AI usage
  • Step-by-step on how to call GPT from Power Automate
  • Real-world use cases to inspire you

Hope you found this helpful. If you're excited about bringing AI into your flows, now is the time to start! Feel free to leave your questions in the comments — I’ll try my best to answer.