Hello! I'm working on a new version of an app which is already used in its current version by thousands of employees in our company.
The app uses a power automate flow which contains a "Run query against a dataset" action. The queried dataset is in a premium capacity, I am admin of that capacity and have all permissions in PowerBI to edit the dataset. All users can use the app without issues. They pull data from the PowerBI dataset via the connector I use in the Power Automate Flow, which is triggered by the PowerApp.
Now, as mentioned, my target is to update the app and improve its structure and functionality. I was wrapping everything in a solution in PowerAutomate. The solution now contains a few flows and the PowerApp.
The first flow which is retrieving the data from the PowerBI dataset is doing exactly the same as it does for the current app, which is not part of a solution.
It works for me, but as soon as other users try to use it, the connector fails and returns an "Unauthorized" response. The users have access to the PowerBI dataset though and the old app still works fine. No issues with the queries against the dataset there. Does anyone have an idea what's going on?
This is the error which is thrown by the "run query against dataset" connector:
{
"statusCode": 401,
"headers": {
"X-PowerBI-Error-Info": "GroupNotAccessible",
"Strict-Transport-Security": "max-age=31536000; includeSubDomains",
"X-Frame-Options": "deny",
"X-Content-Type-Options": "nosniff",
"Access-Control-Expose-Headers": "RequestId,X-PowerBI-Error-Info",
"RequestId": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
"Timing-Allow-Origin": "*",
"x-ms-apihub-cached-response": "true",
"x-ms-apihub-obo": "false",
"Date": "Fri, 25 Aug 2023 09:26:38 GMT",
"Content-Length": "236",
"Content-Type": "application/json"
},
"body": {
"error": {
"code": 401,
"source": "xxxxxxxxxxxxxxxxxxxxxxxxx",
"clientRequestId": "xxxxxxxxxxxxxxxxxxx",
"message": "The response is not in a JSON format.",
"innerError": "Cannot read server response."
}
}
}
The header of the connector shows "Unauthorized":

Edit:
Just did some more troubleshooting and found out something interesting:
There are two ways of adding flows to a PowerApp I can think of.
- Creating and adding a flow from within the app like this:

- I create a flow the classic way like this:

This requires to add the flow manually to the solution in order to make it available and add it in the PowerApp:

When I use the first way, other users cannot run the flow from within the because the PowerBI connector returns the Unauthorized error.
When I use the second way, it works. I just don't understand why. Any help would be much appreciated!