Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Build with Azure AI Search, Speech, OpenAI, and Document Intelligence services.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/sdk/azure-ai-document-intelligence-dotnet.md
1# Azure Document Intelligence — .NET SDK Quick Reference23> Condensed from **azure-ai-document-intelligence-dotnet**. Full patterns (custom models, classifiers, layout extraction)4> in the **azure-ai-document-intelligence-dotnet** plugin skill if installed.56## Install7```bash8dotnet add package Azure.AI.DocumentIntelligence9```1011## Quick Start12```csharp13using Azure.AI.DocumentIntelligence;14var client = new DocumentIntelligenceClient(new Uri(endpoint), credential);15var adminClient = new DocumentIntelligenceAdministrationClient(new Uri(endpoint), credential);16```1718## Non-Obvious Patterns19- Analyze is async LRO: `await client.AnalyzeDocumentAsync(WaitUntil.Completed, "prebuilt-invoice", uri)`20- Field access: `document.Fields.TryGetValue("VendorName", out DocumentField field)`21- Custom model build: `BuildDocumentModelOptions(modelId, DocumentBuildMode.Template, blobSource)`22- Entra ID requires custom subdomain, not regional endpoint2324## Best Practices251. Use DefaultAzureCredential for **local development only**. In production, use ManagedIdentityCredential — see [auth-best-practices.md](../auth-best-practices.md)262. Reuse client instances — clients are thread-safe273. Handle long-running operations with `WaitUntil.Completed`284. Check field confidence — always verify `Confidence` property295. Use appropriate model — prebuilt for common docs, custom for specialized306. Use custom subdomain — required for Entra ID authentication31