ClassifyDocumentAsync WaitForCompletion hangs with no timeout

Jack Halpern 20 Reputation points
2025-09-25T14:06:59.48+00:00

C# development using Azure.AI.FormRecognizer ver 4.1.0

The "WaitForCompletion" method does not have a timeout parameter and sometimes never returns nor throws any errors so the Try/Catch never fires and the thread just hangs forever.

I suspect that the AI is throttling our requests and just giving up on some documents. But we don't get a 429 error. We are using the Standard (S0) pricing. Documentation says we get 15 transactions per second but that should get a 429 if we go over.

My questions are:

  1. Is there a way to force a response to the WaitForCompletion even if it's an error response?
  2. How can I determine if, in fact, we're being throttled? Or if there's some other reason for the hang?
  3. What's best practice for handling "WaitForCompletion"?

Thanks

Jack

Azure Document Intelligence in Foundry Tools

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.