MR
Mayur Rathi
@mayurrathi
⭐ 40.7k GitHub stars

Azure Ai Document Intelligence Dotnet

Azure Ai Document Intelligence Dotnet is an data AI skill with a core value of |. It helps developers solve real-world problems in the data domain, boosting efficiency, automating repetitive tasks, and optimizing workflows.

|

Last verified on: 2026-07-08

Quick Facts

Category data
Works With Claude
Source sickn33/antigravity-awesome-skills
Stars ⭐ 40.7k
Last Verified 2026-07-08
Risk Level Low
mkdir -p ./skills/azure-ai-document-intelligence-dotnet && curl -sfL https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/skills/azure-ai-document-intelligence-dotnet/SKILL.md -o ./skills/azure-ai-document-intelligence-dotnet/SKILL.md

Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).

Skill Content

# Azure.AI.DocumentIntelligence (.NET)


Extract text, tables, and structured data from documents using prebuilt and custom models.


Installation


bash
dotnet add package Azure.AI.DocumentIntelligence
dotnet add package Azure.Identity

**Current Version**: v1.0.0 (GA)


Environment Variables


bash
DOCUMENT_INTELLIGENCE_ENDPOINT=https://<resource-name>.cognitiveservices.azure.com/
DOCUMENT_INTELLIGENCE_API_KEY=<your-api-key>
BLOB_CONTAINER_SAS_URL=https://<storage>.blob.core.windows.net/<container>?<sas-token>

Authentication


Microsoft Entra ID (Recommended)


csharp
using Azure.Identity;
using Azure.AI.DocumentIntelligence;

string endpoint = Environment.GetEnvironmentVariable("DOCUMENT_INTELLIGENCE_ENDPOINT");
var credential = new DefaultAzureCredential();
var client = new DocumentIntelligenceClient(new Uri(endpoint), credential);

> **Note**: Entra ID requires a **custom subdomain** (e.g., `https://<resource-name>.cognitiveservices.azure.com/`), not a regional endpoint.


API Key


csharp
string endpoint = Environment.GetEnvironmentVariable("DOCUMENT_INTELLIGENCE_ENDPOINT");
string apiKey = Environment.GetEnvironmentVariable("DOCUMENT_INTELLIGENCE_API_KEY");
var client = new DocumentIntelligenceClient(new Uri(endpoint), new AzureKeyCredential(apiKey));

Client Types


| Client | Purpose |

|--------|---------|

| `DocumentIntelligenceClient` | Analyze documents, classify documents |

| `DocumentIntelligenceAdministrationClient` | Build/manage custom models and classifiers |


Prebuilt Models


| Model ID | Description |

|----------|-------------|

| `prebuilt-read` | Extract text, languages, handwriting |

| `prebuilt-layout` | Extract text, tables, selection marks, structure |

| `prebuilt-invoice` | Extract invoice fields (vendor, items, totals) |

| `prebuilt-receipt` | Extract receipt fields (merchant, items, total) |

| `prebuilt-idDocument` | Extract ID document fields (name, DOB, address) |

| `prebuilt-businessCard` | Extract business card fields |

| `prebuilt-tax.us.w2` | Extract W-2 tax form fields |

| `prebuilt-healthInsuranceCard.us` | Extract health insurance card fields |


Core Workflows


1. Analyze Invoice


csharp
using Azure.AI.DocumentIntelligence;

Uri invoiceUri = new Uri("https://example.com/invoice.pdf");

Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(
    WaitUntil.Completed, 
    "prebuilt-invoice", 
    invoiceUri);

AnalyzeResult result = operation.Value;

foreach (AnalyzedDocument document in result.Documents)
{
    if (document.Fields.TryGetValue("VendorName", out DocumentField vendorNameField)
        && vendorNameField.FieldType == DocumentFieldType.String)
    {
        string vendorName = vendorNameField.ValueString;
        Console.WriteLine($"Vendor Name: '{vendorName}', confidence: {vendorNameField.Confidence}");
    }

    if (document.Fields.TryGetValue("InvoiceTotal", out DocumentField invoiceTotalField)
        && invoiceTotalField.FieldType == DocumentFieldType.Currency)
    {
        CurrencyValue invoiceTotal = invoiceTotalField.ValueCurrency;
        Console.WriteLine($"Invoice Total: '{invoiceTotal.CurrencySymbol}{invoiceTotal.Amount}'");
    }
    
    // Extract line items
    if (document.Fields.TryGetValue("Items", out DocumentField itemsField)
        && itemsField.FieldType == DocumentFieldType.List)
    {
        foreach (DocumentField item in itemsField.ValueList)
        {
            var itemFields = item.ValueDictionary;
            if (itemFields.TryGetValue("Description", out DocumentField descField))
                Console.WriteLine($"  Item: {descField.ValueString}");
        }
    }
}

2. Extract Layout (Text, Tables, Structure)


csharp
Uri fileUri = new Uri("https://example.com/document.pdf");

Operation<AnalyzeResult> operation = await client.AnalyzeDocumentAsync(
    WaitUntil.Completed, 
    "prebuilt-layout", 
    fileUri);

AnalyzeResult result = operation.Value;

// Extract text 

🎯 Best For

  • Technical writers
  • API documentation teams
  • Claude users
  • Data professionals
  • Analytics teams

💡 Use Cases

  • Generating JSDoc/TSDoc comments
  • Writing README files for new projects
  • Data pipeline auditing
  • Query optimization

📖 How to Use This Skill

  1. 1

    Install the Skill

    Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.

  2. 2

    Load into Your AI Assistant

    Open Claude and reference the skill. Paste the SKILL.md content or use the system prompt tab.

  3. 3

    Apply Azure Ai Document Intelligence Dotnet to Your Work

    Provide context for your task — paste source material, describe your audience, or share existing work to guide the AI.

  4. 4

    Review and Refine

    Edit the AI output for accuracy, tone, and completeness. Add human insight where the AI lacks context.

❓ Frequently Asked Questions

Does it follow my documentation style?

Most documentation skills respect existing style. Provide a style guide or example in your prompt.

How do I install Azure Ai Document Intelligence Dotnet?

Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/azure-ai-document-intelligence-dotnet/SKILL.md, ready to use.

Can I customize this skill for my team?

Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.

⚠️ Common Mistakes to Avoid

Auto-generating without reviewing

AI documentation can contain inaccuracies. Always verify technical accuracy.

Ignoring data quality

AI analysis inherits all data quality issues — profile your data first.

🔗 Related Skills