Forum Discussion
Power BI rest API Dataset Refresh History report, unable to refresh on Workspace
Hi again,
1. Depends what you want to achieve with those Last N refreshes but you might consider this API:
https://learn.microsoft.com/en-us/rest/api/power-bi/admin/get-refreshables
You need to be admin to use it and generally speaking those Admin APIs are quite powerfull.
In case you won't find it helpful you need to write a script with a loop where you actually query each dataset separately and merge the responses into one output.
Basically you will send one request to obtain all Dataset IDs and for each apply the next request.
2. In case you want to publish the report and keep it up to date by itself I have a bad news for you. It is possible but it requires quite a lot of preparations, which involve lot of Azure resources.
I can briefly describe the process:
1. Create and registr your Azure App for authentication.
2. Create a Azure function or anything where you can run your script in a cloud.
3. Run your script with authentication using Azure App secret and ID.
4. Save your API responses in some storage (blob, Azure SQL etc..)
5. Connect to the storage and then your report can run automaticaly.
As you can see, it's a quite a lot of time and effort to implement. BUT it is still possible.
I have tried this API https://learn.microsoft.com/en-us/rest/api/power-bi/admin/get-refreshables
it is getting 0 result
- Migasuke3 years ago
Memorable Member
Do you fulfill requirements?
- AthomePBI7624893 years agoNew Member
Yes I have all those permissions
- Migasuke3 years ago
Memorable Member
Then I don't know what the problem is 🙁.
In all cases you can use the second approach (with bit more effort), where you request all dataset IDs and request history for each.