March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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?
Solved! Go to Solution.
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.
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.
@WATYF 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.
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.
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.
@WATYF wrote:
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.
I've not yet got any update and I'll follow in this thread once I got any new information. Thanks for your patience.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
8 | |
3 | |
2 | |
2 | |
2 |