Power Apps – The server did not receive a response from an upstream server.

Created a Power Automate that I can call from Power Apps. The steps are straight forward:

I am using Solutions, so I created a new Power Automate in the same solution.

And at the end of the Flow I return output to the Power App.

Within the Power App, in studio, I must add it.

Search and add.

Then I can call it using the name. Example:MyFlow.Run(<arguments>).

The outputs are returned as keys, in my case I have a single output, so I can just set a variable to run the Flow and capture the output.

Above gblSomething is my variable. MyFlow is the flow name. location is the key containing the ouput (which I would have set in Power Automate). The bit in brackets is what I am sending as input to the Flow.

Here’s an MS blog post for more info.

So far so good.

In my tests everything worked fine. But when running as a different user I got an error: The server did not receive a response from an upstream server.

Turns out this is because the Flow was connecting to a storage account, and while I had set the connection with my service account, that’s not how Power Apps does things. It uses the context of the user who is running the Power App. So what I did was change the connection in Power Automate to use the service account always.

Click Edit here, in Flow main page.

Click the drop down to change to use the service account.

Now it always uses the service account.