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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
JagadishNallami
Frequent Visitor

Task.Delay while polling export request in PowerBI is not completed after given interval

Hi there,

 

I am refering the following link to export a power bi report through PowerBi api using C#.

https://learn.microsoft.com/en-us/power-bi/developer/embedded/export-to#code-examples

 

But while polling the request, as mentioned in the link, we are also using await Task.Delay(retryafter), to reduce the frequency of requests for polling. But this Task is not completed within given interval(30 seconds in our case). Due to this the execution is blocked forever and we are not able to export the file. Is there any issue with code mentioned above? I tried using  await Task.Delay(retryafter).ConfigureAwait(false) also but no use.

 

Could someone help in understanding what is hapening in this case and possible solution? 

 

Thank you.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @JagadishNallami 
Thank you for reaching out microsoft fabric community forum.
As @lbendlin metioned ,the delay might be too short and increasing the delay duration might help.  instead of 30 seconds, try using a longer delay like 300 seconds (5 minutes).
Using  ConfigureAwait(false) is a good practice to avoid deadlocks, but it might not be sufficient if the underlying issue is related to the export operation itself.
Ensure that you are not hitting any API rate limits. If you are making frequent requests, the API might be throttling your requests, causing delays or failures

If you need any further assistance or have any questions, please feel free to reach us.

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

Thank you.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @JagadishNallami 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you

Anonymous
Not applicable

Hi @JagadishNallami 
Thank you for reaching out microsoft fabric community forum.
As @lbendlin metioned ,the delay might be too short and increasing the delay duration might help.  instead of 30 seconds, try using a longer delay like 300 seconds (5 minutes).
Using  ConfigureAwait(false) is a good practice to avoid deadlocks, but it might not be sufficient if the underlying issue is related to the export operation itself.
Ensure that you are not hitting any API rate limits. If you are making frequent requests, the API might be throttling your requests, causing delays or failures

If you need any further assistance or have any questions, please feel free to reach us.

If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.

Thank you.

lbendlin
Super User
Super User

You need much longer delays. At least 300 seconds.

Hi, here the delay is the value we are receiving in the resposnse headers from the API. Like below

 

var retryAfter = httpMessage.Response.Headers.RetryAfter;

var retryAfterInSec = retryAfter.Delta.Value.Seconds;

await Task.Delay(retryAfterInSec * 1000);

 

You mean to ignore this and add a default timeout?

Try both approaches. We always use 300 seconds and that seems to be robust.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.