Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
miketechspeak
Frequent Visitor

PowerBI Service Too Many Requests for PDF reports

I implemented the export to PDF reports for your customers as detailed here. For our customers to download PDF copies of our reports, which seems to be working OK. 
https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to

 

I also created an internal service, as we want to prebuild a number of reports that don't change as often for ease of download for our customers. After around 20-30 reports, I start getting:
Microsoft.Rest.HttpOperationException: Operation returned an invalid status code '429'
Which won't stop happening for about 15-20 minutes, haven't nailed the exact timeout for it yet. 

NOTE: I am fully respecting the designated built in RetryAfter of 30 seconds that I am getting from the Service. 

I even tried adding an additional 60 seconds between individual report requests. So the whole process was spread out across 40 minutes, with only 86 calls to the PowerBIClient. But that didn't seem to affect the count limit much at all.  

Now I imagine for my purposes I can jury rig my app to wait whatever time I determine is the timeout between calls is. But having a possible limit of 20 reports in a 40 minute period, is rediculously small. Which makes me uncertain about the implementation for my customers as well, as again that is a rather small limit that I imagine will be hit easily during certain high usage times. 

I am not sure where that limit is being enforced from. Is it an accessible setting in either the PowerBI Service, WebClient, or the Azure App that request is using too? And if so, where should I check for them?

Or is this something that is an internal limit in any of them?  

Any thoughts an suggestions?

1 ACCEPTED SOLUTION

Update:
   Apparently the issue I was hitting up against was because of limitations specific to the ExportTo functionality being a preview feature, with it's own very limited limitations as denoted here:
https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to#limitations
What I was hitting up against was a 50 page per hour limit. So I can send as many as I want, as fast as I want , albeit there is no way to batch the requests, that is until the visible page count exceeded 50 pages for the tenant that hour. After which I will continually get the error, until the early requests timeout. 

The current temporary fix is a dumb brute force one of once I get the error, check once every minute until it goes through. As to my knowledge there is no means to interrogate the API to know how close you are to hitting the limit, or when the limit will free up. I thought about trying to keep track of my own requests, but as it is tenantwide, it seemed to likely a possibility, at least for me, that another request could throw off the timing. 
Hopefully the feature goes live soon, so this won't be continually necessary. But if you are hitting this as well. Be sure to reup your authentication token, because that also expires after an hour  as well. 

View solution in original post

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @miketechspeak ,

 

429 Too Many Requests Rate limit exceeded.

You'll need to batch the messages together and reduce the number of messages sent out.

Such as when exception 429 starts throwing code goes to sleep for a while and then continue running.

You could check the limitations:

https://docs.microsoft.com/en-us/power-bi/developer/automation/api-rest-api-limitations 

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Update:
   Apparently the issue I was hitting up against was because of limitations specific to the ExportTo functionality being a preview feature, with it's own very limited limitations as denoted here:
https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to#limitations
What I was hitting up against was a 50 page per hour limit. So I can send as many as I want, as fast as I want , albeit there is no way to batch the requests, that is until the visible page count exceeded 50 pages for the tenant that hour. After which I will continually get the error, until the early requests timeout. 

The current temporary fix is a dumb brute force one of once I get the error, check once every minute until it goes through. As to my knowledge there is no means to interrogate the API to know how close you are to hitting the limit, or when the limit will free up. I thought about trying to keep track of my own requests, but as it is tenantwide, it seemed to likely a possibility, at least for me, that another request could throw off the timing. 
Hopefully the feature goes live soon, so this won't be continually necessary. But if you are hitting this as well. Be sure to reup your authentication token, because that also expires after an hour  as well. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors