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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Gateway to Azure OpenA...
Power Automate
Unanswered

Gateway to Azure OpenAI (Private) fails with 500, cURL works

(0) ShareShare
ReportReport
Posted on by 10

Hi everyone,

I am trying to connect a Power Automate Cloud Flow to an Azure OpenAI Service via an On-Premises Data Gateway. The Azure OpenAI resource has "Public Network Access" disabled and is only reachable via a Private Endpoint.

The Setup:

  • Target: Azure OpenAI (https://at-ai-openai-dev-bue-002.openai.azure.com/...)

  • Gateway Server: Windows Server with On-Premises Data Gateway installed.

  • DNS: I have mapped the domain to the private IP (10.57.x.x) in the local hosts file on the Gateway server.

  • Connector: Custom Connector with "Connect via on-premises data gateway" enabled. Authentication is set to "None" (API Key is passed via Header).

The Problem: When I run a curl command directly on the Gateway Server, it works perfectly and returns the expected JSON from OpenAI. This confirms that DNS, Firewall, and SSL Handshake are working on the OS level.

However, when triggering the Custom Connector from Power Automate, I receive a 500 Error.

The Error in Power Automate:

{
  "status": 500,
  "message": "Received error payload from gateway service with ID XXXXX: <ccon>An error occurred while sending the request.</ccon>.\r\nclientRequestId: ...",
  "error": {
    "message": "Received error payload from gateway service with ID XXXXX: <ccon>An error occurred while sending the request.</ccon>."
  },
  "source": "gatewayconnector-we.azconn-we-004.p.azurewebsites.net"
}

 

What I have verified:

  1. cURL/PowerShell works: The endpoint is reachable from the server console.

  2. Gateway Logs: The request reaches the Gateway but fails locally with "An error occurred while sending the request".

  3. Headers: I am using the api-key header and x-ms-model-mesh-model-name.

My Question: Since the OS can reach the endpoint but the Gateway Service fails: Could this be related to the .NET Runtime used by the Gateway Service not using TLS 1.2 by default? Or are there specific headers that the Gateway Service strips/blocks?

this ist the curl I tested.

curl -X POST "https://at-ai-openai-dev-bue-002.openai.azure.com/openai/v1/chat/completions" -H "Content-Type: application/json" -H "api-key: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" -H "x-ms-model-mesh-model-name: gpt-4o" --data-raw "{\"messages\":[{\"role\":\"system\",\"content\":\"You are a helpful assistant.\"},{\"role\":\"user\",\"content\":\"Write a haiku about the ocean.\"}],\"max_tokens\":100,\"temperature\":0.7}"

Any help is appreciated!

I have the same question (0)

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Valantis Profile Picture

Valantis 377

#2
11manish Profile Picture

11manish 279

#3
David_MA Profile Picture

David_MA 234 Super User 2026 Season 1

Last 30 days Overall leaderboard