Details needed on how to successfully call .NET Document Intelligence client DeleteAnalyzeResult API method

Sean Leino 65 Reputation points
2026-09-04T19:07:59.1166667+00:00

Per various Azure articles, including github data-privacy-security.md and how-does-document-intelligence-process-data, it is suggested that the Document Intelligence client DeleteAnalyzeResult API method should be called if cleaning up data is required. The .NET method, documented here documentintelligenceclient.deleteanalyzeresult requires a model ID and result ID. The model ID information is simple to get as it comes back with the AnalyzeResult information; unfortunately, there does not seem to be a clear result ID returned anywhere and the API documentation does not give any details. Here is our current code snippet below:

    AzureKeyCredential credential = new AzureKeyCredential("<subscriptionKey>");

    DocumentIntelligenceClient client = new DocumentIntelligenceClient("<endpoint_URL", credential);

Operation<AnalyzeResult> operation = client.AnalyzeDocumentAsync(WaitUntil.Completed, analyzeDocumentOptions, CancellationToken.None).GetAwaiter().GetResult();

AnalyzeResult result = operation.Value;

string resultID = operation.Id;

Response response = client.DeleteAnalyzeResult(result.ModelId, resultID);

		

Basically, DeleteAnalyzeResult consistently returns HTTP 204 "No content". I can pretty much pass any resultID value and it will still return HTTP 204.

Where should we get the result ID from and how can we tell if the Delete actually happens?

Azure Document Intelligence in Foundry Tools
0 comments No comments

Answer accepted by question author
SHOUMIK CHAKRAVARTY 575 Reputation points
2026-09-05T02:36:19.2166667+00:00

Hi @Sean Leino - operation.Id is the result ID, so you're already passing the right thing.

string resultID = operation.Id;

204 No Content is a success code. and that's by design. DELETE is idempotent, so deleting something that doesn't exist still succeeds. That's why any value you pass comes back 204, and it's why the status code will never distinguish "removed your result" from "there was nothing there."

The method reference also describes it as "Mark the result of document analysis for deletion", so there isn't a synchronous delete to observe even in principle.

To verify the DELETE outside the SDK. Take a real operation.Id, GET {endpoint}/documentintelligence/documentModels/{modelId}/analyzeResults/{resultId}, and you should get the result back. Delete it, GET again, and you should get a 404. That proves two things at once: that operation.Id is the correct value, and that the delete does what you want. After that you can treat the 204 as sufficient, because you've confirmed the mechanism works.

Help make this community better for everyone: if this answer resolved your issue, please accept it or leave an upvote. If not, share more details in a comment so we can continue the discussion and find the right solution.

Was this answer helpful?

2 people found this answer helpful.

0 additional answers

Sort by: Newest

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.