Extract and Classify Document Data with Azure AI
A .NET SDK skill for extracting text, tables, and structured fields from documents via prebuilt or custom Azure AI models.
Why it matters
Leverage Azure AI Document Intelligence to extract structured data, text, and tables from various document types. Automate the analysis of invoices, receipts, and IDs, and build custom models or classifiers for specialized needs.
Outcomes
What it gets done
Extract text, tables, and key fields from invoices and receipts.
Analyze document layout to extract text content and table structures.
Build custom models for specialized document types.
Classify documents into predefined categories using custom classifiers.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-azure-ai-document-intelligence-dotnet | bash Overview
Azure.AI.DocumentIntelligence (.NET)
A .NET SDK for extracting text, tables, and typed structured fields from documents using prebuilt models (invoices, receipts, IDs) or custom-trained models and classifiers. Use it for document field or structure extraction in a .NET app, not for tasks unrelated to parsing document content.
What it does
Azure.AI.DocumentIntelligence is a .NET SDK for extracting text, tables, and structured data from documents using either Microsoft's prebuilt models or custom-trained ones. Two client types cover the whole surface: DocumentIntelligenceClient for analyzing and classifying documents, and DocumentIntelligenceAdministrationClient for building and managing custom models and classifiers. Eight named prebuilt models cover common document types out of the box - prebuilt-read (text, languages, handwriting), prebuilt-layout (text, tables, selection marks, structure), prebuilt-invoice, prebuilt-receipt, prebuilt-idDocument, prebuilt-businessCard, prebuilt-tax.us.w2, and prebuilt-healthInsuranceCard.us. Installation is a two-package add:
dotnet add package Azure.AI.DocumentIntelligence
dotnet add package Azure.Identity
When to use - and when NOT to
Use this SDK when a .NET application needs to pull structured fields out of documents - vendor name and line items from an invoice, merchant and total from a receipt, or arbitrary text, tables, and selection marks via the layout model - rather than parsing raw document bytes by hand. When prebuilt models don't fit a specialized document type, build a custom model (DocumentBuildMode.Template for fixed-layout forms, DocumentBuildMode.Neural for variable layouts) trained from a blob-container source, or a document classifier to route documents by type before analysis. It supersedes Azure.AI.FormRecognizer, which is explicitly called out as the legacy, deprecated SDK - new projects should use DocumentIntelligence instead. It is not the right tool if the task doesn't involve document field or structure extraction at all.
Inputs and outputs
Input is a document URI, or a blob-container source for training data; output is an AnalyzeResult containing AnalyzedDocument entries with named DocumentFields typed as string, date, number, currency, or list, each carrying a Confidence score, plus page-level DocumentPage/DocumentLine/DocumentTable data for the layout model. For custom models, output is DocumentModelDetails with a per-document-type field schema and confidence; for classifiers, output is a document type label with its own confidence score per analyzed document.
Integrations
Authenticates via Microsoft Entra ID (DefaultAzureCredential, recommended for production, requiring a custom subdomain endpoint rather than a regional one) or a plain AzureKeyCredential API key; training data for custom models and classifiers comes from Azure Blob Storage via a SAS-URL-scoped BlobContentSource. Errors surface as RequestFailedException with a status code and message. Client instances are thread-safe and meant to be reused rather than recreated per call, long-running operations are typically awaited with WaitUntil.Completed for simplicity, and every extracted field's Confidence property should be checked before trusting its value.
Who it's for
.NET developers extracting structured data from invoices, receipts, IDs, business cards, tax forms, or custom document types, who want typed, confidence-scored fields from prebuilt or custom Azure models instead of hand-rolled document parsing.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.