[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6FCX7GVQ8XNFJMNGHSC91TP":3,"skill-same:01M6FCX7GVQ8XNFJMNGHSC91TP":56},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":29,"linkOnly":30,"markdownContent":31,"markdownBody":31,"frontMatter":32,"refName":33,"commitSha":34,"skillDirectory":35,"forksCount":36,"repositoryHtmlUrl":37,"repositoryHomepageUrl":38,"ownerHtmlUrl":39,"ownerBlogUrl":6,"ownerDescription":40,"updatedAt":41,"install":42,"resources":55},"01M6FCX7GVQ8XNFJMNGHSC91TP","azure-ai-document-intelligence-dotnet",null,"ComeOnOliver\u002Fskillshub","ComeOnOliver","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F43215937?v=4","01M6E5JNFECJAAVFE0W7SMWWD2","Haoran Shu","01M6E5JNNDQS7AJZDYFQ8TPZCK",66,"MIT","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-ai-document-intelligence-dotnet\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000002","文档处理","SCENARIO","使用场景",[23,24,25,26,27,28],"dotnet","azure ai","azure","azure ai document intelligence dotnet","document","intelligence","2026-11-10 10:12:30",false,"# 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",{},"main","def8531e65114c0fca8fb8551c1871ee0eed705c","skills\u002Fmicrosoft\u002Fskills\u002Fazure-ai-document-intelligence-dotnet",24,"https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub","https:\u002F\u002Fskillshub.wtf","https:\u002F\u002Fgithub.com\u002FComeOnOliver","AI & Blockchain Engineer\r\n","2026-06-24 22:07:19",{"source":7,"skillName":5,"commands":43,"prompt":53,"zipAvailable":54},[44,47,50],{"tool":45,"command":46},"npx","npx skills add ComeOnOliver\u002Fskillshub --skill azure-ai-document-intelligence-dotnet",{"tool":48,"command":49},"bunx","bunx skills add ComeOnOliver\u002Fskillshub --skill azure-ai-document-intelligence-dotnet",{"tool":51,"command":52},"pnpm","pnpm dlx skills add ComeOnOliver\u002Fskillshub --skill azure-ai-document-intelligence-dotnet","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fmicrosoft\u002Fskills\u002Fazure-ai-document-intelligence-dotnet\u002FSKILL.md",true,[],[57,69,79,88,94,101],{"skillNo":58,"name":59,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":65,"publishedAt":29},"01M6FKJN13GMG4KY57J3QD8GY5","model-hierarchy-skill","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzscole\u002Fmodel-hierarchy-skill\u002Fmodel-hierarchy-skill\u002FSKILL.md",[62],{"categoryNo":63,"categoryName":64,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[66,67,68],"model","model hierarchy","model hierarchy skill",{"skillNo":70,"name":71,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":75,"publishedAt":29},"01M6FKJJJ6GCAMR4PPPRD12M5X","zoom-mcp","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-mcp\u002FSKILL.md",[74],{"categoryNo":63,"categoryName":64,"taxonomyType":20,"taxonomyTypeDesc":21},[76,77,78],"MCP","zoom","zoom mcp",{"skillNo":80,"name":81,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":29},"01M6FKJE3KYT3KPEZMEEHYKA6K","zoom-apps-sdk","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fzoom-apps-sdk\u002FSKILL.md",[],[85,86,87,77],"sdk","zoom apps sdk","apps",{"skillNo":89,"name":90,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":29},"01M6FKJ9EDH9Q5VWDF8HAJRSP0","windows","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwindows\u002FSKILL.md",[],[90],{"skillNo":95,"name":96,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":97,"categories":98,"keywords":100,"publishedAt":29},"01M6FKJ666BEEFC3AE9GJ72Q93","whiteboard","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwhiteboard\u002FSKILL.md",[99],{"categoryNo":63,"categoryName":64,"taxonomyType":20,"taxonomyTypeDesc":21},[96],{"skillNo":102,"name":103,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":104,"categories":105,"keywords":106,"publishedAt":29},"01M6FKJ21WFCDGTJQ2Q91T9DVW","websockets","https:\u002F\u002Fgithub.com\u002FComeOnOliver\u002Fskillshub\u002Fblob\u002Fmain\u002Fskills\u002Fzoom\u002Fskills\u002Fwebsockets\u002FSKILL.md",[],[103]]