Forum Discussion
PowerBINotAuthorizedException when trying to use ExecuteQueries endpoint
Hello! I am trying to use the ExecuteQueries endpoint of the PowerBI API in order to execute some DAX, but for this specific dataset and workspace combination, I am getting a 401 PowerBINotAuthorizedException.
I have added the service principal to the workspace and other endpoints work without issue, such as getting the refresh history.
7 Replies
- lbendlinSuper User
" I am trying to use the ExecuteQueries endpoint of the PowerBI API"
From where? Have you registered an application and have you applied for the required permissions and scope?
Datasets - Execute Queries - REST API (Power BI Power BI REST APIs) | Microsoft Docs
- AnonymousNot applicable
It is executed via Python code, but that is not the issue. The app is properly registered and the service principal is added to the workspace. ExecuteQueries works in other workspaces and in this specific workspace, other endpoints work just fine, besides ExecuteQueries.
- lbendlinSuper User
V2 workspace?
- AnonymousNot applicable
I managed to find why this does not work. It is because the ExecuteQueries API endpoints does not work on datasets using RLS.
- lbendlinSuper User
To be clear, that is only a limitation for the Service Principal - for quite obvious reasons.
Limitations
- Only datasets in a new workspace experience workspace, that is to say a V2 workspace, are supported.
- Datasets that are hosted in Azure Analysis Services or that have a live connection to an on-premises Azure Analysis Services model aren't supported.
- The tenant setting Allow XMLA endpoints and Analyze in Excel with on-premises datasets must be enabled.
- One query per API call.
- One table request per query.
- Maximum of 100,000 table rows per query.
- Service Principals aren't supported for datasets with RLS per RLS limitations and user impersonation isn't supported.