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
Anonymous
Not applicable

All API calls failing after the 3rd consecutive call...

I'm trying to use the REST API to automatically refresh all of my datasets after their data sources are updated every morning. I've written a .NET program that will get the list of Datasets, check who owns them, if it's not me, take ownership and set the Gateway to our on-premises Gateway, and then run the refresh for that Dataset. At most, each Dataset could require up to three API calls (not counting the original call to get the list of Datasets).

 

My problem is that after I run the first three API calls, ALL subsequent calls fail with the message "The operation has timed out". This was with the default timeout of 100 seconds on the WebRequest, and it happens when stepping through the program.

 

It doesn't matter what the first three calls are OR what the next call is that fails (it could be a call to take ownship, or set the Gateway, or run a refresh... makes no difference). For example, if the first two Datasets are already owned by me, it will fail on the attempt to take ownership of the third dataset (i.e. the fourth API call after Get Dataset call and two refresh calls). If the first one isn't owned by me, it will fail on the step to refresh it after taking ownership (i.e. the fouth API call after Get Dataset list, Take ownership, and Set Gateway). Etc. etc.

 

I've tried several differet scenarios and they all play out the same way: after I make my third call, no matter what it is, all the rest time out.

 

If I stop debugging my program and start it up again, I can do three more calls until it fails again, so it's not a "daily limit" or anything like that. I've also waited long amounts of time in between calls (particularly when I was still wokring on the program), so it's not like I'm running the calls too close together.

 

Does anyone know what might be causing this?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

For the record, I found a temporary solution for this until they fix this bug: Closing the ConnectionGroup after each WebRequest is completed.

 

Assuming "wr" is your HttpWebRequest var, just use this line after you call wr.GetResponse.

 

wr.ServicePoint.CloseConnectionGroup(wr.ConnectionGroupName)

 

No more timeouts after the 2nd API POST call.

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

OK, this appears to only be affecting POST calls. I can run GET calls as many times as I want, but on the third POST call, it always times out. I shouldn't have been including the call to get the list of Datasets in my count, since that's a GET call, so it isn't after the 3rd API call (in general) that I get timeouts, but on the 3rd POST call.


@Anonymous wrote:

OK, this appears to only be affecting POST calls. I can run GET calls as many times as I want, but on the third POST call, it always times out. I shouldn't have been including the call to get the list of Datasets in my count, since that's a GET call, so it isn't after the 3rd API call (in general) that I get timeouts, but on the 3rd POST call.


@Anonymous

Thanks for reporting this issue, I could reproduce the similar timeout on the 3rd POST call. I'm going to escalate this internally and would post back if I get any update.

Anonymous
Not applicable

@Eric_Zhang

Is there some workaround in the meantime? Do you know why it fails on the 3rd consequtive call in an instance of a program, but will work again once you restart that same program? I'm disposing of all my objects, and each API call uses a unique WebRequest, so I'm trying to figure out how it even knows that the 3rd call is from the same instance of a program and the 4th (after a restart) is not.


@Anonymous wrote:

@Eric_Zhang

Is there some workaround in the meantime? Do you know why it fails on the 3rd consequtive call in an instance of a program, but will work again once you restart that same program? I'm disposing of all my objects, and each API call uses a unique WebRequest, so I'm trying to figure out how it even knows that the 3rd call is from the same instance of a program and the 4th (after a restart) is not.


@Anonymous

I've not yet got any update and I'll follow in this thread once I got any new information. Thanks for your patience.

Anonymous
Not applicable

For the record, I found a temporary solution for this until they fix this bug: Closing the ConnectionGroup after each WebRequest is completed.

 

Assuming "wr" is your HttpWebRequest var, just use this line after you call wr.GetResponse.

 

wr.ServicePoint.CloseConnectionGroup(wr.ConnectionGroupName)

 

No more timeouts after the 2nd API POST call.

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.