document-intelligence

by Hoverhuang-er

Helm chartv0.2.3App 4.0Verified publisher

Azure AI Document Intelligence container for disconnected (offline) environments

About this chart

Azure AI Document Intelligence Helm Chart

Language: English | 简体中文 | 国内访问

This Helm chart deploys Azure AI Document Intelligence containers in disconnected (offline) environments on Kubernetes.

Overview

Azure AI Document Intelligence containers allow you to run Document Intelligence APIs locally with the benefits of containerization. Disconnected containers are designed for scenarios where no connectivity with Azure cloud is needed after initial setup.

Prerequisites

  • Kubernetes 1.23+
  • Helm 3.8.0+
  • Azure AI Document Intelligence resource with disconnected containers commitment tier
  • Sufficient cluster resources (minimum 8 cores, 16GB memory per pod)
  • Persistent storage provisioner (for license and logs)

Known Limitations

We sincerely apologize for a limitation in this chart regarding special character compatibility.

Due to Kubernetes environment variable naming restrictions and the configuration approach used in this chart, there are known limitations when working with certain special characters in environment variable separators:

  1. Colon (:) is NOT supported as a configurable separator - this is a Kubernetes-enforced limitation that we cannot work around in the current implementation
  2. The chart uses double underscore (__) as the default separator for maximum compatibility
  3. While dot (.), hyphen (-), and single underscore (_) are technically supported, they may cause issues in certain Kubernetes versions or environments

We understand this limitation may cause inconvenience when migrating from configurations that use colon separators. We are working on improving this in future versions to provide better flexibility while maintaining Kubernetes compatibility. If you have specific use cases that require alternative separator characters, please open an issue so we can understand your needs better.

For detailed configuration options and workarounds, please see the Environment Variable Separator Configuration section below.

Supported Models

This chart supports the following Document Intelligence models:

ModelImage RepositoryMinimum MemoryRecommended Memory
Readform-recognizer/read-4.08GB16GB
Layoutform-recognizer/layout-3.016GB24GB
Invoiceform-recognizer/invoice-3.016GB24GB
Receiptform-recognizer/receipt-3.011GB24GB
Business Cardform-recognizer/businesscard-3.016GB24GB
ID Documentform-recognizer/idDocument-3.08GB24GB
General Documentform-recognizer/generaldocument-3.012GB24GB
Custom Templateform-recognizer/custom-template-3.016GB24GB

Installation

Quick Start with all-in-one.yaml

For quick deployment without Helm, you can use the pre-rendered all-in-one.yaml manifest:

# Deploy directly with kubectl
kubectl apply -f https://raw.githubusercontent.com/Hoverhuang-er/charts/main/Microsoft/azure-ai-services/charts/document-intelligence/all-in-one.yaml

Note: The all-in-one.yaml uses default configurations. For production deployments or custom configurations, use Helm installation methods below.

Step 1: Request Access

Before using disconnected containers:

  1. Submit a request form for access
  2. Purchase a commitment plan in Azure Portal
  3. Create an Azure AI Document Intelligence resource with "Commitment tier disconnected containers DC0" pricing tier

Step 2: Initial Setup (License Download)

First, deploy the chart with license download enabled to obtain the license file:

helm install document-intelligence ./document-intelligence \
  --set documentIntelligence.azure.billingEndpoint="https://your-resource.cognitiveservices.azure.com" \
  --set documentIntelligence.azure.apiKey="your-api-key" \
  --set documentIntelligence.azure.downloadLicense=true

Wait for the pod to complete license download (check logs):

kubectl logs -f deployment/document-intelligence

Step 3: Switch to Disconnected Mode

After license is downloaded, upgrade to disconnected mode:

helm upgrade document-intelligence ./document-intelligence \
  --set documentIntelligence.azure.downloadLicense=false

Alternative: Use Pre-downloaded License

If you already have a downloaded license.dat file, you can provide it directly:

# Encode the license file
LICENSE_DATA=$(base64 < license.dat)

# Deploy with the license data (no download needed)
helm install document-intelligence ./document-intelligence \
  --set documentIntelligence.license.licenseData="$LICENSE_DATA"

This creates a Kubernetes Secret with the license file, eliminating the need for:

  • Initial license download step
  • License PVC (saves storage costs)
  • Azure credentials in production

See LICENSE-FILE-USAGE.md for detailed instructions and additional methods.

Configuration

Key Parameters

ParameterDescriptionDefault
kubernetesVersionKubernetes version (1.32, 1.28, 1.26, 1.24, pre-1.24)1.32
image.repositoryContainer image repositorymcr.microsoft.com/azure-cognitive-services/form-recognizer/read-4.0
image.tagContainer image taglatest
documentIntelligence.modelTypeModel type (read, layout, invoice, etc.)read
documentIntelligence.envSeparatorSeparator for mount env vars (__, _, ., -)__
documentIntelligence.azure.billingEndpointAzure billing endpoint (for license download)""
documentIntelligence.azure.apiKeyAzure API key (for license download)""
documentIntelligence.azure.downloadLicenseEnable license download modefalse
documentIntelligence.license.mountPathLicense storage path/license
documentIntelligence.license.storageSizeLicense PVC size1Gi
documentIntelligence.output.mountPathUsage logs storage path/logs
documentIntelligence.output.storageSizeOutput PVC size5Gi
ingress.enabledEnable ingresstrue
ingress.controllerTypeIngress controller (azure-loadbalancer, application-gateway, nginx)azure-loadbalancer
resources.requests.memoryMemory request16Gi
resources.requests.cpuCPU request8
resources.limits.memoryMemory limit24Gi
resources.limits.cpuCPU limit8
service.typeKubernetes service typeClusterIP
service.portService port5000

Advanced Configuration Parameters

ParameterDescriptionDefaultRange
documentIntelligence.advanced.storageTimeToLiveInMinutesTTL for intermediate/final files2880 (2 days)5-10080 min
documentIntelligence.advanced.taskMaxRunningTimeSpanInMinutesRequest timeout threshold601+ min
documentIntelligence.advanced.healthCheckMemoryUpperboundInMBMemory health check thresholdautoMB
documentIntelligence.advanced.queueAzureConnectionStringAzure Queue connection (custom template)""-
documentIntelligence.advanced.storageObjectStoreAzureBlobConnectionStringAzure Blob connection (custom template)""-
documentIntelligence.advanced.httpProxyBypassUrlsProxy bypass URLs""CSV
documentIntelligence.advanced.performance.oneOcrConcurrencyOneOCR parallel operations"" (auto)4-16
documentIntelligence.advanced.performance.ocrWorkerThreadPoolSizeOCR worker threads"" (auto)2-8
documentIntelligence.advanced.performance.queuePriorityExtraConcurrentWorkerCountPriority queue workers"" (auto)0-4
documentIntelligence.advanced.logging.consoleLogLevelConsole log levelInformationSee below

Log Levels: Trace, Debug, Information, Warning, Error, Critical, None

Performance Tuning: The performance parameters (oneOcrConcurrency, ocrWorkerThreadPoolSize, queuePriorityExtraConcurrentWorkerCount) are disabled by default for optimal resource usage. Enable them for high-volume scenarios. See values-advanced-example.yaml for recommended settings.

Example: Deploy Invoice Model

helm install invoice-analyzer ./document-intelligence \
  --set image.repository="mcr.microsoft.com/azure-cognitive-services/form-recognizer/invoice-3.0" \
  --set documentIntelligence.modelType=invoice \
  --set documentIntelligence.azure.billingEndpoint="https://your-resource.cognitiveservices.azure.com" \
  --set documentIntelligence.azure.apiKey="your-api-key" \
  --set documentIntelligence.azure.downloadLicense=true

Kubernetes Version Compatibility

This chart supports multiple Kubernetes versions. Set the kubernetesVersion parameter:

# For Kubernetes 1.32 (default)
helm install document-intelligence ./document-intelligence

# For Kubernetes 1.24
helm install document-intelligence ./document-intelligence \
  --set kubernetesVersion="1.24"

# For Kubernetes versions before 1.24 (disables securityContext)
helm install document-intelligence ./document-intelligence \
  --set kubernetesVersion="pre-1.24"

Note: Kubernetes versions before 1.24 will have securityContext disabled for compatibility.

Ingress Configuration

The chart creates an Ingress resource by default. Choose your ingress controller:

Azure Load Balancer (Default)

helm install document-intelligence ./document-intelligence \
  --set ingress.controllerType="azure-loadbalancer" \
  --set ingress.hosts[0].host="document-intelligence.example.com"

Azure Application Gateway Ingress Controller (AGIC)

helm install document-intelligence ./document-intelligence \
  --set ingress.controllerType="application-gateway" \
  --set ingress.hosts[0].host="document-intelligence.example.com"

NGINX Ingress Controller

helm install document-intelligence ./document-intelligence \
  --set ingress.controllerType="nginx" \
  --set ingress.hosts[0].host="document-intelligence.example.com"

Disable Ingress

helm install document-intelligence ./document-intelligence \
  --set ingress.enabled=false

Environment Variable Separator Configuration

The chart allows you to customize the separator character used in mount-related environment variables (Mounts__License, Mounts__Output, Mounts__Shared). This is useful for compatibility with different Azure AI Services container versions.

Default: double underscore (__) - Recommended for Kubernetes compatibility

  • Generates: Mounts__License, Mounts__Output, Mounts__Shared

Available options: __ (double underscore, default), _ (single underscore), . (dot), - (hyphen)

⚠️ Important Notes:

  • Colon (:) is NOT supported for user-configurable separators due to Kubernetes restrictions
  • Some Azure container environment variables use colons (e.g., Task:MaxRunningTimeSpanInMinutes) - these are hardcoded in the deployment template with proper quoting
  • Dot (.) may cause issues in older Kubernetes versions
  • Double underscore (__) is the safest and recommended option

Using Single Underscore

helm install document-intelligence ./document-intelligence \
  --set documentIntelligence.envSeparator="_"
# Generates: Mounts_License, Mounts_Output, Mounts_Shared
# Note: May cause Helm rendering issues in some versions

Using Hyphen

helm install document-intelligence ./document-intelligence \
  --set documentIntelligence.envSeparator="-"
# Generates: Mounts-License, Mounts-Output, Mounts-Shared

Using Dot

helm install document-intelligence ./document-intelligence \
  --set documentIntelligence.envSeparator="."
# Generates: Mounts.License, Mounts.Output, Mounts.Shared

In values.yaml

documentIntelligence:
  envSeparator: "__"  # Default: double underscore (recommended)
  # Other options: "_", ".", "-"
  # Note: Colon ":" is NOT supported

Using Existing PVCs

If you have existing PersistentVolumeClaims for license or logs:

helm install document-intelligence ./document-intelligence \
  --set documentIntelligence.license.existingClaim="my-license-pvc" \
  --set documentIntelligence.output.existingClaim="my-output-pvc"

Advanced Configuration Examples

Configure Storage TTL and Task Timeout

helm install document-intelligence ./document-intelligence \
  --set documentIntelligence.advanced.storageTimeToLiveInMinutes=1440 \
  --set documentIntelligence.advanced.taskMaxRunningTimeSpanInMinutes=120 \
  --set documentIntelligence.advanced.logging.consoleLogLevel="Debug"

Configure Performance Tuning for High-Volume Scenarios

helm install document-intelligence ./document-intelligence \
  --set documentIntelligence.advanced.performance.oneOcrConcurrency=8 \
  --set documentIntelligence.advanced.performance.ocrWorkerThreadPoolSize=3 \
  --set documentIntelligence.advanced.performance.queuePriorityExtraConcurrentWorkerCount=1

Note: Performance tuning increases resource usage. Ensure sufficient CPU and memory are allocated.

Configure with Azure Queue and Blob Storage (Custom Template)

helm install document-intelligence ./document-intelligence \
  --set documentIntelligence.modelType=customTemplate \
  --set documentIntelligence.advanced.queueAzureConnectionString="DefaultEndpointsProtocol=https;..." \
  --set documentIntelligence.advanced.storageObjectStoreAzureBlobConnectionString="DefaultEndpointsProtocol=https;..."

Use Advanced Configuration File

See values-advanced-example.yaml for a complete example with all advanced parameters.

helm install document-

Deploy document-intelligence with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has document-intelligence on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartdocument-intelligence is pinned at v0.2.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply