Forum Discussion
GetDatasetUsersAsAdmin - Too Many Requests
- 5 years ago
Hi saunders ,
the API doc states a max. of 200 requests per hour. So you'd have to split it up into 10 chunks to retrieve those values: Admin - Datasets GetDatasetUsersAsAdmin - REST API (Power BI Power BI REST APIs) | Microsoft Docs
You might consider using Power Automate for it instead, so you can export the results of the chunks into a central location. Setting up a custom connector in there is also much easier than in Power Query.
Hi saunders ,
the API doc states a max. of 200 requests per hour. So you'd have to split it up into 10 chunks to retrieve those values: Admin - Datasets GetDatasetUsersAsAdmin - REST API (Power BI Power BI REST APIs) | Microsoft Docs
You might consider using Power Automate for it instead, so you can export the results of the chunks into a central location. Setting up a custom connector in there is also much easier than in Power Query.
- saunders5 years ago
Helper II
Hi Imke, just to follow up -
I'm using the same Power Query code to return the report users and that query is successful. The number of reports in our tenant is 2,367 and the number of datsets is 1,959. Very strange that the query works with reports but not with datasets. Querying the GetDatasetUsersAsAdmin results in Too Many Requests.
I'll log a ticket with MS support so they can investigate further.
Thanks.
- lbendlin5 years ago
Super User
ImkeF would you mind showing how the authentication would work in Power Automate? Or would you need to register an app?
- ImkeF5 years ago
Community Champion
Hi lbendlin ,
yes, of course, you would have to register an app to access this data.- lbendlin5 years ago
Super User
That's the beauty of Miguel's solution - no app required. Of course with the drawback that AAD is not supported on the PowerBI service (as far as I know? - would be happy to be proven wrong).
- saunders5 years ago
Helper II
Thanks Imke, I missed that API limit in the doc. So if I have 2000 datasets, my code will try to query the endpoint 2000 times because it sends a query for each dataset id. Obviously with a limit of 200 requests per hour, this will take 10 hours if my code waits in between each request.
Do you know how I can restructure my code to avoid making a call to the API for each and every dataset id? I'm not even sure how I would do this is in Python or Power Automate because surely the code still needs to make a call for every dataset id.
In any case thanks again!