Azure OpenAI own data request from PowerAutomate fails "Gateway cannot authenticate upstream services. Please contact Microsoft for help."

JoeLAP 30 Reputation points
2023-09-01T13:27:32.9833333+00:00

Hi,

I'm trying to build an app that uses Azure OpenAI:s chat extensions endpoint https://MYINSTANCE.openai.azure.com/openai/deployments/MYDEPLOYMENTNAME/extensions/chat/completions?api-version=2023-08-01-preview

From Postman it works correctly. But from PowerAutomate it gives error 500 body:

{
  "error": {
    "code": "InternalServerError",
    "message": "Gateway cannot authenticate upstream services. Please contact Microsoft for help."
  }
}


Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
2,112 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Saurabh Sharma 23,666 Reputation points Microsoft Employee
    2023-09-05T18:28:14.77+00:00

    Hi @JoeLAP ,

    Resolution from OP (@JoeLAP ) Posting as Answer, to help other find this resolution.

    I didn't have any network restrictions. But due to having a closer look I noticed the mistake I made in PowerAutomate. I tried to use the same api-key in body (for embeddings) and header for endpoint https://MYINSTANCE.openai.azure.com/openai/deployments/MYDEPLOYMENTNAME/extensions/chat/completions?api-version=2023-08-01-preview even though I was using another resource for the embeddings. Tested and works after changing the correct api-key for embeddings. :)

    Please "Accept the answer" to help others in the community.

    Thanks

    Saurabh