web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help Connecting Azure ...
Power Automate
Unanswered

Help Connecting Azure OpenAI Model with Data Source in Power Automate

(2) ShareShare
ReportReport
Posted on by 14
Hi everyone,
   I am currently implementing a Power Automate flow that connects to an Azure OpenAI model.
        Here's what I’ve done so far:
  • I created and deployed an Azure OpenAI model using Azure AI Foundry.
  • I used the text-embedding-ada-002 model for vector search. The vectorized data is stored in Azure SQL Database.
  • I integrated this data with Azure AI Search by importing and vectorizing it.
  • I then deployed a GPT-4o model on Azure AI Foundry, configured instructions, and set Azure AI Search (connected to the embedded data) as the data source.
  • When I test the model in the Azure AI Foundry chat interface, it works correctly. It follows the instructions and fetches relevant data from the database.

    The issue: When I try to use this model in Power Automate via an HTTP action:
  • I use the endpoint and API key from Azure AI Foundry.
  • In the body of the HTTP request, I use the same JSON structure that works in the Foundry interface.
  • I use a Compose action to extract the response

    However, the model's response in Power Automate does not fetch data from the database correctly. Sometimes it says "no data found", or returns irrelevant data — even though the same input gives correct results within Azure AI Foundry.

    My questions are:
  • How can I properly connect the Azure OpenAI model along with its data source in Power Automate?
    Do I need to make a separate HTTP call to the embedding model as well?
    If yes, what should I include in the
    Body section of that request?
    Or is there another recommended approach to achieve this integration?
  • Is there any way to change the output format of the response we get in the Azure AI Foundry chat?
    For example, to return data in a custom JSON or a more structured format instead of plain text.

    Thank you!



Categories:
I have the same question (0)
  • Lagortinez Profile Picture
    128 Super User 2025 Season 2 on at
    Hi there!
     
    I see that in the content, you're using the outputs of the compose, and giving it to the API Params already. Since you stablished the Data Source in Foundry, I think you don't need to pass it again from Power Automate, that wouldn't make sense to me. 
     
    One piece of advice I would give you is that you play with the network tab, trying to isolate the API Call you are making in foundry, and mimic the same behaviour in Power Automate.
     
    I fear this might be linked with the vector database behind it, but finiding the request behind it might help you out :)
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    The HTTP post body, is a place that you have to implicitly specify what you want the API to do.
    There is no “magic” behind the scenes in Power Automate: whatever the service expects, you must put into your JSON payload.
    The current one you got is kind of you have the access to the endpoint, that's all.
    you can consider this as that you send a shopping list to someone, which only contains the destination.
    so wrap the post body, so the other side knows exactly what to do.
    good luck.
     
  • H.Hassan Profile Picture
    14 on at
    @Lagortinez

    Thanks for your response!

    I removed the Compose action and tested again, but I’m still not getting a response from the added data source.
    Regarding the Network tab suggestion — could you please explain a bit more?

  • H.Hassan Profile Picture
    14 on at
    @stampcoin

    Thanks for the reply!
    Right now, I’ve added the system and user roles in the JSON body, along with parameters like temperature, as shown in the screenshot I’ve attached.
    Could you please guide me on what exactly I need to include in the JSON body to enable vector search, so the model fetches data from the added data source?

    Appreciate your help!


     
  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    I think you need to implicitly specify the AI Search Endpoint in this scope, you data source.
     
     
    The doc tells that ( as what I understand):
    • Where ( search endpoint and index name).
    • How ( which embedding model).
    • Authentication/authorization ( search API key).
    Below is python snippet from Microsoft, for HTTP post, it should be the same or similar.
     
     
     
    If you have more parameter, you wrap it in the body.  
    feel free if you have any questions.
     
     
     
     
  • H.Hassan Profile Picture
    14 on at
    @stampcoin
    should I need to add all of these?

  • stampcoin Profile Picture
    5,058 Super User 2025 Season 2 on at
    @ Hi,
    Maybe you can specify the mandatory ones, once that works, you add more fields.
    Use python or other tools will be much easier for testing than power automate, once you make progress, will be easy to take action in power automate.
     
    good luck.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard