In a C# Azure.AI.DocumentIntelligence application, how do I AnalyzeDocumentAsync() on a local file?

David Liptak 20 Reputation points
2024-11-19T20:24:20.66+00:00

In a C# Azure.AI.DocumentIntelligence application, how do I AnalyzeDocumentAsync() on a local file?

Azure AI Document Intelligence
Azure AI Document Intelligence
An Azure service that turns documents into usable data. Previously known as Azure Form Recognizer.
1,746 questions
0 comments No comments
{count} votes

Accepted answer
  1. Brandon G 85 Reputation points
    2024-11-19T21:37:38.1733333+00:00
    
    var file = "path_to_local_file";
        var content = new AnalyzeDocumentContent();
        var docFileBytes = File.ReadAllBytes(file);
        content.Base64Source = BinaryData.FromBytes(docFileBytes);
    
        var operation = await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", content);
    
    
    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

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