title | titleSuffix | description | author | manager | ms.service | ms.topic | ms.date | ms.collection | ms.author |
---|---|---|---|---|---|---|---|---|---|
Configure Read containers - Azure AI Vision |
Azure AI services |
This article shows you how to configure both required and optional settings for Read optical character recognition (OCR) containers in Azure AI Vision. |
aahill |
nitinme |
azure-ai-vision |
how-to |
02/21/2025 |
ce-skilling-fresh-tier2, ce-skilling-ai-copilot |
aahi |
You can configure the Azure AI Vision Read OCR container's runtime environment by using the docker run
command arguments. This container has some required settings, along with a few optional settings. Several examples of the command are available. The container-specific settings are the billing settings.
[!INCLUDE Container shared configuration settings table]
Important
The ApiKey
, Billing
, and Eula
settings are used together, and you must provide valid values for all three of them; otherwise your container won't start. For more information about using these configuration settings to instantiate a container, see Billing.
The container also has the following container-specific configuration settings:
Required | Setting | Purpose |
---|---|---|
No | ReadEngineConfig:ResultExpirationPeriod |
v2.0 containers only. Result expiration period in hours. The default is 48 hours. The setting specifies when the system should clear recognition results. For example, if resultExpirationPeriod=1 , the system clears the recognition result 1 hour after the process. If resultExpirationPeriod=0 , the system clears the recognition result after the result is retrieved. |
No | Cache:Redis |
v2.0 containers only. Enables Redis storage for storing results. A cache is required if multiple read OCR containers are placed behind a load balancer. |
No | Queue:RabbitMQ |
v2.0 containers only. Enables RabbitMQ for dispatching tasks. The setting is useful when multiple read OCR containers are placed behind a load balancer. |
No | Queue:Azure:QueueVisibilityTimeoutInMilliseconds |
v3.x containers only. The time for a message to be invisible when another worker is processing it. |
No | Storage::DocumentStore::MongoDB |
v2.0 containers only. Enables MongoDB for permanent result storage. |
No | Storage:ObjectStore:AzureBlob:ConnectionString |
v3.x containers only. Azure blob storage connection string. |
No | Storage:TimeToLiveInDays |
v3.x containers only. Result expiration period in days. The setting specifies when the system should clear recognition results. The default is two days, which means any result that's live for longer than that period isn't guaranteed to be successfully retrieved. The value is integer and it must be between one day to seven days. |
No | StorageTimeToLiveInMinutes |
v3.2-model-2021-09-30-preview and new containers. Result expiration period in minutes. The setting specifies when the system should clear recognition results. The default is two days (2,880 minutes), which means any result that's live for longer than that period isn't guaranteed to be successfully retrieved. The value is integer and it must be between 60 minutes to seven days (10080 minutes). |
No | Task:MaxRunningTimeSpanInMinutes |
v3.x containers only. Maximum running time for a single request. The default is 60 minutes. |
No | EnableSyncNTPServer |
v3.x containers only, except for v3.2-model-2021-09-30-preview and newer containers. Enables the NTP server synchronization mechanism, which ensures synchronization between the system time and expected task runtime. Note that this requires external network traffic. The default is true . |
No | NTPServerAddress |
v3.x containers only, except for v3.2-model-2021-09-30-preview and newer containers. NTP server for the time sync-up. The default is time.windows.com . |
No | Mounts:Shared |
v3.x containers only. Local folder for storing recognition result. The default is /share . For running container without using Azure blob storage, we recommend mounting a volume to this folder to ensure you have enough space for the recognition results. |
The ApiKey
setting specifies the Vision resource key used to track billing information for the container. You must specify a value for the ApiKey and the value must be a valid key for the Vision resource specified for the Billing
configuration setting.
This setting can be found in the following place:
- Azure portal: Azure AI services Resource Management, under Keys
[!INCLUDE Container shared configuration ApplicationInsights settings]
The Billing
setting specifies the endpoint URI of the Azure AI services resource on Azure used to meter billing information for the container. You must specify a value for this configuration setting, and the value must be a valid endpoint URI for an Azure AI services resource on Azure. The container reports usage about every 10 to 15 minutes.
This setting can be found in the following place:
- Azure portal: Azure AI services Overview; labeled
Endpoint
Remember to add the vision/<version>
routing to the endpoint URI as shown in the following table.
Required | Name | Data type | Description |
---|---|---|---|
Yes | Billing |
String | Billing endpoint URI Example: Billing=https://westcentralus.api.cognitive.microsoft.com/vision/v3.2 |
[!INCLUDE Container shared configuration eula settings]
[!INCLUDE Container shared configuration fluentd settings]
[!INCLUDE Container shared configuration HTTP proxy settings]
[!INCLUDE Container shared configuration logging settings]
Use bind mounts to read and write data to and from the container. You can specify an input mount or output mount by specifying the --mount
option in the docker run command.
The Azure AI Vision containers don't use input or output mounts to store training or service data.
The exact syntax of the host mount location varies depending on the host operating system. Additionally, the host computer's mount location might not be accessible due to a conflict between permissions used by the Docker service account and the host mount location permissions.
Optional | Name | Data type | Description |
---|---|---|---|
Not allowed | Input |
String | Azure AI Vision containers don't use this field. |
Optional | Output |
String | The target of the output mount. The default value is /output . This is the location of the logs. This includes container logs. Example: --mount type=bind,src=c:\output,target=/output |
The following examples use the configuration settings to illustrate how to write and use docker run
commands. Once running, the container continues to run until you stop it.
- Line-continuation character: The Docker commands in the following sections use the back slash,
\
, as a line continuation character. Replace or remove this based on your host operating system's requirements. - Argument order: Do not change the order of the arguments unless you're familiar with Docker containers.
Replace {argument_name} with your own values:
Placeholder | Value | Format or example |
---|---|---|
{API_KEY} | The endpoint key of the Vision resource on the resource keys page. | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
{ENDPOINT_URI} | The billing endpoint value is available on the resource overview page. | See gather required parameters for explicit examples. |
[!INCLUDE subdomains-note]
Important
The Eula
, Billing
, and ApiKey
options must be specified to run the container; otherwise, the container won't start. For more information, see Billing.
The ApiKey value is the Key from the Vision resource keys page.
The following Docker examples are for the Read OCR container.
docker run --rm -it -p 5000:5000 --memory 16g --cpus 8 \
mcr.microsoft.com/azure-cognitive-services/vision/read:3.2-model-2022-04-30 \
Eula=accept \
Billing={ENDPOINT_URI} \
ApiKey={API_KEY}
docker run --rm -it -p 5000:5000 --memory 16g --cpus 8 \
mcr.microsoft.com/azure-cognitive-services/vision/read:3.2-model-2022-04-30 \
Eula=accept \
Billing={ENDPOINT_URI} \
ApiKey={API_KEY}
Logging:Console:LogLevel:Default=Information
docker run --rm -it -p 5000:5000 --memory 16g --cpus 8 \
mcr.microsoft.com/azure-cognitive-services/vision/read:2.0-preview \
Eula=accept \
Billing={ENDPOINT_URI} \
ApiKey={API_KEY}
docker run --rm -it -p 5000:5000 --memory 16g --cpus 8 \
mcr.microsoft.com/azure-cognitive-services/vision/read:2.0-preview \
Eula=accept \
Billing={ENDPOINT_URI} \
ApiKey={API_KEY}
Logging:Console:LogLevel:Default=Information
[div class="nextstepaction"] Review How to install and run containers.