[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6G8VD3RGBQ5S80NF5MDD3BH":3,"skill-same:01M6G8VD3RGBQ5S80NF5MDD3BH":81},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":27,"publishedAt":48,"linkOnly":49,"markdownContent":50,"markdownBody":51,"frontMatter":52,"refName":55,"commitSha":56,"skillDirectory":57,"forksCount":13,"repositoryHtmlUrl":58,"repositoryHomepageUrl":6,"ownerHtmlUrl":59,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":60,"install":61,"resources":74},"01M6G8VD3RGBQ5S80NF5MDD3BH","azure-ai-document-intelligence-dotnet",null,"Azure AI Document Intelligence SDK for .NET. Extract text, tables, and structured data from documents using prebuilt and custom models. Use for invoice processing, receipt extraction, ID document analysis, and custom document models. Triggers: \"Document Intelligence\", \"DocumentIntelligenceClient\", \"form recognizer\", \"invoice extraction\", \"receipt OCR\", \"document analysis .NET\".","ricardoaevt\u002Fnexus-roms","ricardoaevt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F164531880?v=4","01M6DGFGSV6CF9AKPHABBREC79","01M6DGFGYNNPJVDFQA05TDPSBN",0,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fmicrosoft_skills\u002F.github\u002Fplugins\u002Fazure-sdk-dotnet\u002Fskills\u002Fazure-ai-document-intelligence-dotnet\u002FSKILL.md",[17,22],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",{"categoryNo":23,"categoryName":24,"taxonomyType":25,"taxonomyTypeDesc":26},"01JBSEEDCAT000000000000040","财务","PROFESSION","适用职业",[28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47],"dotnet","azure ai","azure","azure ai document intelligence dotnet","intelligence","document","text","tables","processing","form","id","triggers","models","use","structured data","analysis","ocr","data","documents","sdk","2026-11-10 10:12:30",false,"---\nname: azure-ai-document-intelligence-dotnet\ndescription: |\n  Azure AI Document Intelligence SDK for .NET. Extract text, tables, and structured data from documents using prebuilt and custom models. Use for invoice processing, receipt extraction, ID document analysis, and custom document models. Triggers: \"Document Intelligence\", \"DocumentIntelligenceClient\", \"form recognizer\", \"invoice extraction\", \"receipt OCR\", \"document analysis .NET\".\npackage: Azure.AI.DocumentIntelligence\n---\n\n# Azure.AI.DocumentIntelligence (.NET)\n\nExtract text, tables, and structured data from documents using prebuilt and custom models.\n\n## Installation\n\n```bash\ndotnet add package Azure.AI.DocumentIntelligence\ndotnet add package Azure.Identity\n```\n\n**Current Version**: v1.0.0 (GA)\n\n## Environment Variables\n\n```bash\nDOCUMENT_INTELLIGENCE_ENDPOINT=https:\u002F\u002F\u003Cresource-name>.cognitiveservices.azure.com\u002F\nDOCUMENT_INTELLIGENCE_API_KEY=\u003Cyour-api-key>\nBLOB_CONTAINER_SAS_URL=https:\u002F\u002F\u003Cstorage>.blob.core.windows.net\u002F\u003Ccontainer>?\u003Csas-token>\n```\n\n## Authentication\n\n### Microsoft Entra ID (Recommended)\n\n```csharp\nusing Azure.Identity;\nusing Azure.AI.DocumentIntelligence;\n\nstring endpoint = Environment.GetEnvironmentVariable(\"DOCUMENT_INTELLIGENCE_ENDPOINT\");\nvar credential = new DefaultAzureCredential();\nvar client = new DocumentIntelligenceClient(new Uri(endpoint), credential);\n```\n\n> **Note**: Entra ID requires a **custom subdomain** (e.g., `https:\u002F\u002F\u003Cresource-name>.cognitiveservices.azure.com\u002F`), not a regional endpoint.\n\n### API Key\n\n```csharp\nstring endpoint = Environment.GetEnvironmentVariable(\"DOCUMENT_INTELLIGENCE_ENDPOINT\");\nstring apiKey = Environment.GetEnvironmentVariable(\"DOCUMENT_INTELLIGENCE_API_KEY\");\nvar client = new DocumentIntelligenceClient(new Uri(endpoint), new AzureKeyCredential(apiKey));\n```\n\n## Client Types\n\n| Client | Purpose |\n|--------|---------|\n| `DocumentIntelligenceClient` | Analyze documents, classify documents |\n| `DocumentIntelligenceAdministrationClient` | Build\u002Fmanage custom models and classifiers |\n\n## Prebuilt Models\n\n| Model ID | Description |\n|----------|-------------|\n| `prebuilt-read` | Extract text, languages, handwriting |\n| `prebuilt-layout` | Extract text, tables, selection marks, structure |\n| `prebuilt-invoice` | Extract invoice fields (vendor, items, totals) |\n| `prebuilt-receipt` | Extract receipt fields (merchant, items, total) |\n| `prebuilt-idDocument` | Extract ID document fields (name, DOB, address) |\n| `prebuilt-businessCard` | Extract business card fields |\n| `prebuilt-tax.us.w2` | Extract W-2 tax form fields |\n| `prebuilt-healthInsuranceCard.us` | Extract health insurance card fields |\n\n## Core Workflows\n\n### 1. Analyze Invoice\n\n```csharp\nusing Azure.AI.DocumentIntelligence;\n\nUri invoiceUri = new Uri(\"https:\u002F\u002Fexample.com\u002Finvoice.pdf\");\n\nOperation\u003CAnalyzeResult> operation = await client.AnalyzeDocumentAsync(\n    WaitUntil.Completed, \n    \"prebuilt-invoice\", \n    invoiceUri);\n\nAnalyzeResult result = operation.Value;\n\nforeach (AnalyzedDocument document in result.Documents)\n{\n    if (document.Fields.TryGetValue(\"VendorName\", out DocumentField vendorNameField)\n        && vendorNameField.FieldType == DocumentFieldType.String)\n    {\n        string vendorName = vendorNameField.ValueString;\n        Console.WriteLine($\"Vendor Name: '{vendorName}', confidence: {vendorNameField.Confidence}\");\n    }\n\n    if (document.Fields.TryGetValue(\"InvoiceTotal\", out DocumentField invoiceTotalField)\n        && invoiceTotalField.FieldType == DocumentFieldType.Currency)\n    {\n        CurrencyValue invoiceTotal = invoiceTotalField.ValueCurrency;\n        Console.WriteLine($\"Invoice Total: '{invoiceTotal.CurrencySymbol}{invoiceTotal.Amount}'\");\n    }\n    \n    \u002F\u002F Extract line items\n    if (document.Fields.TryGetValue(\"Items\", out DocumentField itemsField)\n        && itemsField.FieldType == DocumentFieldType.List)\n    {\n        foreach (DocumentField item in itemsField.ValueList)\n        {\n            var itemFields = item.ValueDictionary;\n            if (itemFields.TryGetValue(\"Description\", out DocumentField descField))\n                Console.WriteLine($\"  Item: {descField.ValueString}\");\n        }\n    }\n}\n```\n\n### 2. Extract Layout (Text, Tables, Structure)\n\n```csharp\nUri fileUri = new Uri(\"https:\u002F\u002Fexample.com\u002Fdocument.pdf\");\n\nOperation\u003CAnalyzeResult> operation = await client.AnalyzeDocumentAsync(\n    WaitUntil.Completed, \n    \"prebuilt-layout\", \n    fileUri);\n\nAnalyzeResult result = operation.Value;\n\n\u002F\u002F Extract text by page\nforeach (DocumentPage page in result.Pages)\n{\n    Console.WriteLine($\"Page {page.PageNumber}: {page.Lines.Count} lines, {page.Words.Count} words\");\n    \n    foreach (DocumentLine line in page.Lines)\n    {\n        Console.WriteLine($\"  Line: '{line.Content}'\");\n    }\n}\n\n\u002F\u002F Extract tables\nforeach (DocumentTable table in result.Tables)\n{\n    Console.WriteLine($\"Table: {table.RowCount} rows x {table.ColumnCount} columns\");\n    foreach (DocumentTableCell cell in table.Cells)\n    {\n        Console.WriteLine($\"  Cell ({cell.RowIndex}, {cell.ColumnIndex}): {cell.Content}\");\n    }\n}\n```\n\n### 3. Analyze Receipt\n\n```csharp\nOperation\u003CAnalyzeResult> operation = await client.AnalyzeDocumentAsync(\n    WaitUntil.Completed, \n    \"prebuilt-receipt\", \n    receiptUri);\n\nAnalyzeResult result = operation.Value;\n\nforeach (AnalyzedDocument document in result.Documents)\n{\n    if (document.Fields.TryGetValue(\"MerchantName\", out DocumentField merchantField))\n        Console.WriteLine($\"Merchant: {merchantField.ValueString}\");\n        \n    if (document.Fields.TryGetValue(\"Total\", out DocumentField totalField))\n        Console.WriteLine($\"Total: {totalField.ValueCurrency.Amount}\");\n        \n    if (document.Fields.TryGetValue(\"TransactionDate\", out DocumentField dateField))\n        Console.WriteLine($\"Date: {dateField.ValueDate}\");\n}\n```\n\n### 4. Build Custom Model\n\n```csharp\nvar adminClient = new DocumentIntelligenceAdministrationClient(\n    new Uri(endpoint), \n    new AzureKeyCredential(apiKey));\n\nstring modelId = \"my-custom-model\";\nUri blobContainerUri = new Uri(\"\u003Cblob-container-sas-url>\");\n\nvar blobSource = new BlobContentSource(blobContainerUri);\nvar options = new BuildDocumentModelOptions(modelId, DocumentBuildMode.Template, blobSource);\n\nOperation\u003CDocumentModelDetails> operation = await adminClient.BuildDocumentModelAsync(\n    WaitUntil.Completed, \n    options);\n\nDocumentModelDetails model = operation.Value;\n\nConsole.WriteLine($\"Model ID: {model.ModelId}\");\nConsole.WriteLine($\"Created: {model.CreatedOn}\");\n\nforeach (var docType in model.DocumentTypes)\n{\n    Console.WriteLine($\"Document type: {docType.Key}\");\n    foreach (var field in docType.Value.FieldSchema)\n    {\n        Console.WriteLine($\"  Field: {field.Key}, Confidence: {docType.Value.FieldConfidence[field.Key]}\");\n    }\n}\n```\n\n### 5. Build Document Classifier\n\n```csharp\nstring classifierId = \"my-classifier\";\nUri blobContainerUri = new Uri(\"\u003Cblob-container-sas-url>\");\n\nvar sourceA = new BlobContentSource(blobContainerUri) { Prefix = \"TypeA\u002Ftrain\" };\nvar sourceB = new BlobContentSource(blobContainerUri) { Prefix = \"TypeB\u002Ftrain\" };\n\nvar docTypes = new Dictionary\u003Cstring, ClassifierDocumentTypeDetails>()\n{\n    { \"TypeA\", new ClassifierDocumentTypeDetails(sourceA) },\n    { \"TypeB\", new ClassifierDocumentTypeDetails(sourceB) }\n};\n\nvar options = new BuildClassifierOptions(classifierId, docTypes);\n\nOperation\u003CDocumentClassifierDetails> operation = await adminClient.BuildClassifierAsync(\n    WaitUntil.Completed, \n    options);\n\nDocumentClassifierDetails classifier = operation.Value;\nConsole.WriteLine($\"Classifier ID: {classifier.ClassifierId}\");\n```\n\n### 6. Classify Document\n\n```csharp\nstring classifierId = \"my-classifier\";\nUri documentUri = new Uri(\"https:\u002F\u002Fexample.com\u002Fdocument.pdf\");\n\nvar options = new ClassifyDocumentOptions(classifierId, documentUri);\n\nOperation\u003CAnalyzeResult> operation = await client.ClassifyDocumentAsync(\n    WaitUntil.Completed, \n    options);\n\nAnalyzeResult result = operation.Value;\n\nforeach (AnalyzedDocument document in result.Documents)\n{\n    Console.WriteLine($\"Document type: {document.DocumentType}, confidence: {document.Confidence}\");\n}\n```\n\n### 7. Manage Models\n\n```csharp\n\u002F\u002F Get resource details\nDocumentIntelligenceResourceDetails resourceDetails = await adminClient.GetResourceDetailsAsync();\nConsole.WriteLine($\"Custom models: {resourceDetails.CustomDocumentModels.Count}\u002F{resourceDetails.CustomDocumentModels.Limit}\");\n\n\u002F\u002F Get specific model\nDocumentModelDetails model = await adminClient.GetModelAsync(\"my-model-id\");\nConsole.WriteLine($\"Model: {model.ModelId}, Created: {model.CreatedOn}\");\n\n\u002F\u002F List models\nawait foreach (DocumentModelDetails modelItem in adminClient.GetModelsAsync())\n{\n    Console.WriteLine($\"Model: {modelItem.ModelId}\");\n}\n\n\u002F\u002F Delete model\nawait adminClient.DeleteModelAsync(\"my-model-id\");\n```\n\n## Key Types Reference\n\n| Type | Description |\n|------|-------------|\n| `DocumentIntelligenceClient` | Main client for analysis |\n| `DocumentIntelligenceAdministrationClient` | Model management |\n| `AnalyzeResult` | Result of document analysis |\n| `AnalyzedDocument` | Single document within result |\n| `DocumentField` | Extracted field with value and confidence |\n| `DocumentFieldType` | String, Date, Number, Currency, etc. |\n| `DocumentPage` | Page info (lines, words, selection marks) |\n| `DocumentTable` | Extracted table with cells |\n| `DocumentModelDetails` | Custom model metadata |\n| `BlobContentSource` | Training data source |\n\n## Build Modes\n\n| Mode | Use Case |\n|------|----------|\n| `DocumentBuildMode.Template` | Fixed layout documents (forms) |\n| `DocumentBuildMode.Neural` | Variable layout documents |\n\n## Best Practices\n\n1. **Use DefaultAzureCredential** for production\n2. **Reuse client instances** — clients are thread-safe\n3. **Handle long-running operations** — Use `WaitUntil.Completed` for simplicity\n4. **Check field confidence** — Always verify `Confidence` property\n5. **Use appropriate model** — Prebuilt for common docs, custom for specialized\n6. **Use custom subdomain** — Required for Entra ID authentication\n\n## Error Handling\n\n```csharp\nusing Azure;\n\ntry\n{\n    var operation = await client.AnalyzeDocumentAsync(\n        WaitUntil.Completed, \n        \"prebuilt-invoice\", \n        documentUri);\n}\ncatch (RequestFailedException ex)\n{\n    Console.WriteLine($\"Error: {ex.Status} - {ex.Message}\");\n}\n```\n\n## Related SDKs\n\n| SDK | Purpose | Install |\n|-----|---------|---------|\n| `Azure.AI.DocumentIntelligence` | Document analysis (this SDK) | `dotnet add package Azure.AI.DocumentIntelligence` |\n| `Azure.AI.FormRecognizer` | Legacy SDK (deprecated) | Use DocumentIntelligence instead |\n\n## Reference Links\n\n| Resource | URL |\n|----------|-----|\n| NuGet Package | https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FAzure.AI.DocumentIntelligence |\n| API Reference | https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fazure.ai.documentintelligence |\n| GitHub Samples | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-net\u002Ftree\u002Fmain\u002Fsdk\u002Fdocumentintelligence\u002FAzure.AI.DocumentIntelligence\u002Fsamples |\n| Document Intelligence Studio | https:\u002F\u002Fdocumentintelligence.ai.azure.com\u002F |\n| Prebuilt Models | https:\u002F\u002Faka.ms\u002Fazsdk\u002Fformrecognizer\u002Fmodels |\n","# Azure.AI.DocumentIntelligence (.NET)\n\nExtract text, tables, and structured data from documents using prebuilt and custom models.\n\n## Installation\n\n```bash\ndotnet add package Azure.AI.DocumentIntelligence\ndotnet add package Azure.Identity\n```\n\n**Current Version**: v1.0.0 (GA)\n\n## Environment Variables\n\n```bash\nDOCUMENT_INTELLIGENCE_ENDPOINT=https:\u002F\u002F\u003Cresource-name>.cognitiveservices.azure.com\u002F\nDOCUMENT_INTELLIGENCE_API_KEY=\u003Cyour-api-key>\nBLOB_CONTAINER_SAS_URL=https:\u002F\u002F\u003Cstorage>.blob.core.windows.net\u002F\u003Ccontainer>?\u003Csas-token>\n```\n\n## Authentication\n\n### Microsoft Entra ID (Recommended)\n\n```csharp\nusing Azure.Identity;\nusing Azure.AI.DocumentIntelligence;\n\nstring endpoint = Environment.GetEnvironmentVariable(\"DOCUMENT_INTELLIGENCE_ENDPOINT\");\nvar credential = new DefaultAzureCredential();\nvar client = new DocumentIntelligenceClient(new Uri(endpoint), credential);\n```\n\n> **Note**: Entra ID requires a **custom subdomain** (e.g., `https:\u002F\u002F\u003Cresource-name>.cognitiveservices.azure.com\u002F`), not a regional endpoint.\n\n### API Key\n\n```csharp\nstring endpoint = Environment.GetEnvironmentVariable(\"DOCUMENT_INTELLIGENCE_ENDPOINT\");\nstring apiKey = Environment.GetEnvironmentVariable(\"DOCUMENT_INTELLIGENCE_API_KEY\");\nvar client = new DocumentIntelligenceClient(new Uri(endpoint), new AzureKeyCredential(apiKey));\n```\n\n## Client Types\n\n| Client | Purpose |\n|--------|---------|\n| `DocumentIntelligenceClient` | Analyze documents, classify documents |\n| `DocumentIntelligenceAdministrationClient` | Build\u002Fmanage custom models and classifiers |\n\n## Prebuilt Models\n\n| Model ID | Description |\n|----------|-------------|\n| `prebuilt-read` | Extract text, languages, handwriting |\n| `prebuilt-layout` | Extract text, tables, selection marks, structure |\n| `prebuilt-invoice` | Extract invoice fields (vendor, items, totals) |\n| `prebuilt-receipt` | Extract receipt fields (merchant, items, total) |\n| `prebuilt-idDocument` | Extract ID document fields (name, DOB, address) |\n| `prebuilt-businessCard` | Extract business card fields |\n| `prebuilt-tax.us.w2` | Extract W-2 tax form fields |\n| `prebuilt-healthInsuranceCard.us` | Extract health insurance card fields |\n\n## Core Workflows\n\n### 1. Analyze Invoice\n\n```csharp\nusing Azure.AI.DocumentIntelligence;\n\nUri invoiceUri = new Uri(\"https:\u002F\u002Fexample.com\u002Finvoice.pdf\");\n\nOperation\u003CAnalyzeResult> operation = await client.AnalyzeDocumentAsync(\n    WaitUntil.Completed, \n    \"prebuilt-invoice\", \n    invoiceUri);\n\nAnalyzeResult result = operation.Value;\n\nforeach (AnalyzedDocument document in result.Documents)\n{\n    if (document.Fields.TryGetValue(\"VendorName\", out DocumentField vendorNameField)\n        && vendorNameField.FieldType == DocumentFieldType.String)\n    {\n        string vendorName = vendorNameField.ValueString;\n        Console.WriteLine($\"Vendor Name: '{vendorName}', confidence: {vendorNameField.Confidence}\");\n    }\n\n    if (document.Fields.TryGetValue(\"InvoiceTotal\", out DocumentField invoiceTotalField)\n        && invoiceTotalField.FieldType == DocumentFieldType.Currency)\n    {\n        CurrencyValue invoiceTotal = invoiceTotalField.ValueCurrency;\n        Console.WriteLine($\"Invoice Total: '{invoiceTotal.CurrencySymbol}{invoiceTotal.Amount}'\");\n    }\n    \n    \u002F\u002F Extract line items\n    if (document.Fields.TryGetValue(\"Items\", out DocumentField itemsField)\n        && itemsField.FieldType == DocumentFieldType.List)\n    {\n        foreach (DocumentField item in itemsField.ValueList)\n        {\n            var itemFields = item.ValueDictionary;\n            if (itemFields.TryGetValue(\"Description\", out DocumentField descField))\n                Console.WriteLine($\"  Item: {descField.ValueString}\");\n        }\n    }\n}\n```\n\n### 2. Extract Layout (Text, Tables, Structure)\n\n```csharp\nUri fileUri = new Uri(\"https:\u002F\u002Fexample.com\u002Fdocument.pdf\");\n\nOperation\u003CAnalyzeResult> operation = await client.AnalyzeDocumentAsync(\n    WaitUntil.Completed, \n    \"prebuilt-layout\", \n    fileUri);\n\nAnalyzeResult result = operation.Value;\n\n\u002F\u002F Extract text by page\nforeach (DocumentPage page in result.Pages)\n{\n    Console.WriteLine($\"Page {page.PageNumber}: {page.Lines.Count} lines, {page.Words.Count} words\");\n    \n    foreach (DocumentLine line in page.Lines)\n    {\n        Console.WriteLine($\"  Line: '{line.Content}'\");\n    }\n}\n\n\u002F\u002F Extract tables\nforeach (DocumentTable table in result.Tables)\n{\n    Console.WriteLine($\"Table: {table.RowCount} rows x {table.ColumnCount} columns\");\n    foreach (DocumentTableCell cell in table.Cells)\n    {\n        Console.WriteLine($\"  Cell ({cell.RowIndex}, {cell.ColumnIndex}): {cell.Content}\");\n    }\n}\n```\n\n### 3. Analyze Receipt\n\n```csharp\nOperation\u003CAnalyzeResult> operation = await client.AnalyzeDocumentAsync(\n    WaitUntil.Completed, \n    \"prebuilt-receipt\", \n    receiptUri);\n\nAnalyzeResult result = operation.Value;\n\nforeach (AnalyzedDocument document in result.Documents)\n{\n    if (document.Fields.TryGetValue(\"MerchantName\", out DocumentField merchantField))\n        Console.WriteLine($\"Merchant: {merchantField.ValueString}\");\n        \n    if (document.Fields.TryGetValue(\"Total\", out DocumentField totalField))\n        Console.WriteLine($\"Total: {totalField.ValueCurrency.Amount}\");\n        \n    if (document.Fields.TryGetValue(\"TransactionDate\", out DocumentField dateField))\n        Console.WriteLine($\"Date: {dateField.ValueDate}\");\n}\n```\n\n### 4. Build Custom Model\n\n```csharp\nvar adminClient = new DocumentIntelligenceAdministrationClient(\n    new Uri(endpoint), \n    new AzureKeyCredential(apiKey));\n\nstring modelId = \"my-custom-model\";\nUri blobContainerUri = new Uri(\"\u003Cblob-container-sas-url>\");\n\nvar blobSource = new BlobContentSource(blobContainerUri);\nvar options = new BuildDocumentModelOptions(modelId, DocumentBuildMode.Template, blobSource);\n\nOperation\u003CDocumentModelDetails> operation = await adminClient.BuildDocumentModelAsync(\n    WaitUntil.Completed, \n    options);\n\nDocumentModelDetails model = operation.Value;\n\nConsole.WriteLine($\"Model ID: {model.ModelId}\");\nConsole.WriteLine($\"Created: {model.CreatedOn}\");\n\nforeach (var docType in model.DocumentTypes)\n{\n    Console.WriteLine($\"Document type: {docType.Key}\");\n    foreach (var field in docType.Value.FieldSchema)\n    {\n        Console.WriteLine($\"  Field: {field.Key}, Confidence: {docType.Value.FieldConfidence[field.Key]}\");\n    }\n}\n```\n\n### 5. Build Document Classifier\n\n```csharp\nstring classifierId = \"my-classifier\";\nUri blobContainerUri = new Uri(\"\u003Cblob-container-sas-url>\");\n\nvar sourceA = new BlobContentSource(blobContainerUri) { Prefix = \"TypeA\u002Ftrain\" };\nvar sourceB = new BlobContentSource(blobContainerUri) { Prefix = \"TypeB\u002Ftrain\" };\n\nvar docTypes = new Dictionary\u003Cstring, ClassifierDocumentTypeDetails>()\n{\n    { \"TypeA\", new ClassifierDocumentTypeDetails(sourceA) },\n    { \"TypeB\", new ClassifierDocumentTypeDetails(sourceB) }\n};\n\nvar options = new BuildClassifierOptions(classifierId, docTypes);\n\nOperation\u003CDocumentClassifierDetails> operation = await adminClient.BuildClassifierAsync(\n    WaitUntil.Completed, \n    options);\n\nDocumentClassifierDetails classifier = operation.Value;\nConsole.WriteLine($\"Classifier ID: {classifier.ClassifierId}\");\n```\n\n### 6. Classify Document\n\n```csharp\nstring classifierId = \"my-classifier\";\nUri documentUri = new Uri(\"https:\u002F\u002Fexample.com\u002Fdocument.pdf\");\n\nvar options = new ClassifyDocumentOptions(classifierId, documentUri);\n\nOperation\u003CAnalyzeResult> operation = await client.ClassifyDocumentAsync(\n    WaitUntil.Completed, \n    options);\n\nAnalyzeResult result = operation.Value;\n\nforeach (AnalyzedDocument document in result.Documents)\n{\n    Console.WriteLine($\"Document type: {document.DocumentType}, confidence: {document.Confidence}\");\n}\n```\n\n### 7. Manage Models\n\n```csharp\n\u002F\u002F Get resource details\nDocumentIntelligenceResourceDetails resourceDetails = await adminClient.GetResourceDetailsAsync();\nConsole.WriteLine($\"Custom models: {resourceDetails.CustomDocumentModels.Count}\u002F{resourceDetails.CustomDocumentModels.Limit}\");\n\n\u002F\u002F Get specific model\nDocumentModelDetails model = await adminClient.GetModelAsync(\"my-model-id\");\nConsole.WriteLine($\"Model: {model.ModelId}, Created: {model.CreatedOn}\");\n\n\u002F\u002F List models\nawait foreach (DocumentModelDetails modelItem in adminClient.GetModelsAsync())\n{\n    Console.WriteLine($\"Model: {modelItem.ModelId}\");\n}\n\n\u002F\u002F Delete model\nawait adminClient.DeleteModelAsync(\"my-model-id\");\n```\n\n## Key Types Reference\n\n| Type | Description |\n|------|-------------|\n| `DocumentIntelligenceClient` | Main client for analysis |\n| `DocumentIntelligenceAdministrationClient` | Model management |\n| `AnalyzeResult` | Result of document analysis |\n| `AnalyzedDocument` | Single document within result |\n| `DocumentField` | Extracted field with value and confidence |\n| `DocumentFieldType` | String, Date, Number, Currency, etc. |\n| `DocumentPage` | Page info (lines, words, selection marks) |\n| `DocumentTable` | Extracted table with cells |\n| `DocumentModelDetails` | Custom model metadata |\n| `BlobContentSource` | Training data source |\n\n## Build Modes\n\n| Mode | Use Case |\n|------|----------|\n| `DocumentBuildMode.Template` | Fixed layout documents (forms) |\n| `DocumentBuildMode.Neural` | Variable layout documents |\n\n## Best Practices\n\n1. **Use DefaultAzureCredential** for production\n2. **Reuse client instances** — clients are thread-safe\n3. **Handle long-running operations** — Use `WaitUntil.Completed` for simplicity\n4. **Check field confidence** — Always verify `Confidence` property\n5. **Use appropriate model** — Prebuilt for common docs, custom for specialized\n6. **Use custom subdomain** — Required for Entra ID authentication\n\n## Error Handling\n\n```csharp\nusing Azure;\n\ntry\n{\n    var operation = await client.AnalyzeDocumentAsync(\n        WaitUntil.Completed, \n        \"prebuilt-invoice\", \n        documentUri);\n}\ncatch (RequestFailedException ex)\n{\n    Console.WriteLine($\"Error: {ex.Status} - {ex.Message}\");\n}\n```\n\n## Related SDKs\n\n| SDK | Purpose | Install |\n|-----|---------|---------|\n| `Azure.AI.DocumentIntelligence` | Document analysis (this SDK) | `dotnet add package Azure.AI.DocumentIntelligence` |\n| `Azure.AI.FormRecognizer` | Legacy SDK (deprecated) | Use DocumentIntelligence instead |\n\n## Reference Links\n\n| Resource | URL |\n|----------|-----|\n| NuGet Package | https:\u002F\u002Fwww.nuget.org\u002Fpackages\u002FAzure.AI.DocumentIntelligence |\n| API Reference | https:\u002F\u002Flearn.microsoft.com\u002Fdotnet\u002Fapi\u002Fazure.ai.documentintelligence |\n| GitHub Samples | https:\u002F\u002Fgithub.com\u002FAzure\u002Fazure-sdk-for-net\u002Ftree\u002Fmain\u002Fsdk\u002Fdocumentintelligence\u002FAzure.AI.DocumentIntelligence\u002Fsamples |\n| Document Intelligence Studio | https:\u002F\u002Fdocumentintelligence.ai.azure.com\u002F |\n| Prebuilt Models | https:\u002F\u002Faka.ms\u002Fazsdk\u002Fformrecognizer\u002Fmodels |\n",{"name":5,"package":53,"description":54},"Azure.AI.DocumentIntelligence","Azure AI Document Intelligence SDK for .NET. Extract text, tables, and structured data from documents using prebuilt and custom models. Use for invoice processing, receipt extraction, ID document analysis, and custom document models. Triggers: \"Document Intelligence\", \"DocumentIntelligenceClient\", \"form recognizer\", \"invoice extraction\", \"receipt OCR\", \"document analysis .NET\".\n","main","d41309588593cee5c2fb44062474efc3a99fbcb6",".agent\u002Fskills\u002Fmicrosoft_skills\u002F.github\u002Fplugins\u002Fazure-sdk-dotnet\u002Fskills\u002Fazure-ai-document-intelligence-dotnet","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms","https:\u002F\u002Fgithub.com\u002Fricardoaevt","2026-03-23 00:05:03",{"source":8,"skillName":5,"commands":62,"prompt":72,"zipAvailable":73},[63,66,69],{"tool":64,"command":65},"npx","npx skills add ricardoaevt\u002Fnexus-roms --skill azure-ai-document-intelligence-dotnet",{"tool":67,"command":68},"bunx","bunx skills add ricardoaevt\u002Fnexus-roms --skill azure-ai-document-intelligence-dotnet",{"tool":70,"command":71},"pnpm","pnpm dlx skills add ricardoaevt\u002Fnexus-roms --skill azure-ai-document-intelligence-dotnet","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fmicrosoft_skills\u002F.github\u002Fplugins\u002Fazure-sdk-dotnet\u002Fskills\u002Fazure-ai-document-intelligence-dotnet\u002FSKILL.md",true,[75],{"path":76,"resourceType":77,"resourceTypeDesc":78,"sizeBytes":79,"sourceHtmlUrl":80},"references\u002Facceptance-criteria.md","REFERENCE","参考文档",14853,"https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fmicrosoft_skills\u002F.github\u002Fplugins\u002Fazure-sdk-dotnet\u002Fskills\u002Fazure-ai-document-intelligence-dotnet\u002Freferences\u002Facceptance-criteria.md",[82,106,122,137,148,157],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":48},"01M6G9HYKQRK6HBKVTZM3258M3","openspec-propose","Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.","MIT","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-propose\u002FSKILL.md",[],[90,91,92,93,94,95,96,97,98,99,100,41,101,102,103,104,105],"openspec propose","openspec","cli","generated","with","proposal","complete","get","build","implementation","ready","user","artifacts","tasks","change","design",{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":48},"01M6G9HV9V20WFCHYVSDNQMJVK","openspec-new-change","Start a new OpenSpec change using the experimental artifact workflow. Use when the user wants to create a new feature, fix, or modification with a structured step-by-step approach.","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-new-change\u002FSKILL.md",[],[91,113,104,114,92,115,116,117,41,101,118,119,120,121,94],"openspec new change","new feature","structured","artifact","workflow","create","start","fix","feature",{"skillNo":123,"name":124,"nameZh":6,"description":125,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":126,"categories":127,"keywords":128,"publishedAt":48},"01M6G9HRF6R89QZXGSFC9DRQW3","openspec-explore","Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-explore\u002FSKILL.md",[],[129,130,91,41,131,92,104,101,132,133,134,135,136],"openspec explore","explore","partner","think","thinking partner","thinking","ideas","requirements",{"skillNo":138,"name":139,"nameZh":6,"description":140,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":141,"categories":142,"keywords":143,"publishedAt":48},"01M6G9HP3APFCXZG7XRWBMM524","openspec-continue-change","Continue working on an OpenSpec change by creating the next artifact. Use when the user wants to progress their change, create the next artifact, or continue their workflow.","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-continue-change\u002FSKILL.md",[],[91,144,145,104,117,92,118,101,41,146,116,147],"continue","openspec continue change","next","progress",{"skillNo":149,"name":150,"nameZh":6,"description":151,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":152,"categories":153,"keywords":154,"publishedAt":48},"01M6G9HKT3WMSDBSKA7YM4MSSQ","openspec-archive-change","Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-archive-change\u002FSKILL.md",[],[155,91,156,104,92,117,101,41,99,96],"openspec archive change","archive",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":86,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":48},"01M6G9HHEG0RJK4E0YTVZZ6A8T","openspec-apply-change","Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-apply-change\u002FSKILL.md",[],[91,104,164,165,103,119,144,166,101,41,99,92],"openspec apply change","implement","work"]