Description
Library name and version
Azure.AI.DocumentIntelligence v1.0.0
Describe the bug
n version 1.0.0
of the Azure.AI.DocumentIntelligence
SDK, there is no available method to retrieve the status or result of an analysis operation using the operation ID, unless you wait for the full completion of the process via WaitUntil.Completed
.
While AnalyzeDocumentAsync(WaitUntil.Started, ...)
allows starting the analysis and immediately returning control, there is no follow-up method to poll or retrieve the result later using the operation ID. This limits flexibility in long-running operations, especially in non-blocking or distributed processing scenarios.
However, the corresponding REST API does support this pattern. According to the official documentation (Get Analyze Result – REST API), it is possible to fetch the result using the operation ID after submission, which is not currently supported in the SDK.
Expected behavior
The SDK should expose a method (e.g., GetAnalyzeResultAsync(string operationId)
or similar) that allows users to retrieve the result of a previously started document analysis operation using the operation ID, consistent with the capabilities of the REST API.
This would bring the SDK to feature parity with the REST API and enable more advanced use cases such as distributed processing or job tracking.
Actual behavior
Calling AnalyzeDocumentAsync
with WaitUntil.Started
starts the analysis operation and returns an Operation<AnalyzeResult>
object, but there is no method available to later retrieve the result using the operation ID or URI.
As a result, once the method returns, there is no supported SDK way to check the status or fetch the final result unless WaitUntil.Completed
was used initially. This prevents scenarios where the result is intended to be processed at a later time or from a different service context.
There is no method like client.GetAnalyzeResultAsync(...)
or similar to resume/poll the operation. This makes the "Start only" usage incomplete in practice.
Reproduction Steps
var client = new DocumentIntelligenceClient(new Uri(endpoint), new AzureKeyCredential(apiKey));
using var stream = File.OpenRead("example.pdf");
// Start document analysis without waiting for completion
var operation = await client.AnalyzeDocumentAsync(WaitUntil.Started, "prebuilt-read", stream);
// At this point, there is no SDK method to later fetch the result using operation.Id
// operation.WaitForCompletionAsync() is not usable if you want to retrieve it later
// There should be a method like:
// var result = await client.GetAnalyzeResultAsync(operation.Id);
// But no such method exists in the SDK
Expected output: ability to resume the operation by ID
Actual output: no API available to poll or resume the analysis once started
Environment
No response