Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi there!
I am using the PowerBI API from an external application, trying to export PBI reports from it but keep having the same vague error message:
{
"message": "{\"error\":{\"code\":\"InvalidRequest\",\"message\":\"Export report was called with a bad request\"}}",
"error": true,
"errorCode": "",
"logout": false,
"data": []
}
I have seen some messages in here with similar issues but none has worked for my case. I am not really sure where to watch since I couldn't find what should be the proper configuration to be sent to the API, but when sending the reportConfig variable as empty, I can export the file (which makes no sense to me). This is my current reportconfig.identities object:
"identities": [
{
"customData": null,
"datasets": ["cacd616a-9d18-4b8d-a072-12888be88566"],
"identityBlob": null,
"reports": null,
"roles": [],
"username": "root@root.com"
}
]
I have seen in previous interventions that some versions needed to delete the reports property in order to adapt to the latest changes of the API but it did not solve my issue.
Does anybody have dealt with something similar or has any idea on how to deal with this?
Yes, RLS is activated in the dataset. It has worked until recently, I had some error before related to the roles, I have added a conditional with an empty array for strings and the roles error disappeared, but now I have this one. I don't know, it seems like something has happened since the code hasn't been modified for a long time.
@frolesti I think that an effective identity with username and without roles isn't valid in most scenarios.
Why aren't you passing the required role?
Hi
We are not passing roles since we are dealing with the reports fom an external application and the roles are manually added from there, so most of the roles come back as empty.
I don't know if there is some kind of standard role such as "reader" or something like that that can provide an existing role and will prevent the error from happening.
I am not profficient in PowerBI so I did not know that this was so conflictive. I'd like to know as well if you recommend to pass this role from powerBI or should I pass it in the backend of my app to act as a safenet.
Thank you in advance!
Hi @frolesti ,
Seems that you are trying to provide an effective identity for your dataset.
Does your dataset have RLS applied? If not then I think this is the reason for the error. The only reason for providing an effective identity for a dataset is for applying RLS filtering during the export rendering.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
4 | |
2 | |
1 | |
1 |
User | Count |
---|---|
29 | |
3 | |
3 | |
2 | |
2 |