> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getlimina.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Guide For Integrating Limina DEID Container With Azure OCR

> Learn how to seamlessly integrate Limina's DEID container with Azure OCR for efficient redaction of PII in images and documents.

This guide provides step-by-step instructions on setting up the Limina container with the Azure OCR for processing images and documents. Both the cloud and containerized versions of Azure OCR are supported.

Our general recommendation is Azure Document Intelligence.

<Info>
  For Japanese documents, we recommend Azure Computer Vision for more accurate results.
</Info>

## Prerequisites

### Access to Limina's DEID container

See [Grabbing the Image](/installation/grabbing-the-image) for more info on this.

## Integrating Azure OCR with Limina

<Steps>
  <Step title="Create Azure OCR Service">
    Setup **one** of the following Azure OCR service to use with Limina DEID Container:
    Please check out our [Guide for OCR Modes Available with Limina DEID Container](/configuration-and-operations/working-with-files/processing-files/ocr-modes) to see the different modes of OCR supported by Limina DEID Container.

    **Azure Document Intelligence Service**

    1. Navigate to the Azure Portal.
    2. Create a new Azure Document Intelligence service by following the link: [Create Document Intelligence](https://portal.azure.com/#create/Microsoft.CognitiveServicesFormRecognizer)
    3. Note down your Document Intelligence service endpoint and the key.

    **Or Azure Computer Vision Service**

    1. Navigate to the Azure Portal.
    2. Create a new Azure Computer Vision service by following the link: [Create Computer Vision](https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision)
    3. Note down your service endpoint and the key.
  </Step>

  <Step title="Start the container with Azure OCR service">
    Open a terminal and run the following command to start the container:

    ```shell Docker Run Command  theme={"theme":"poimandres"}
    docker run --rm -v "/path/to/license/my-license-file.json":/app/license/license.json \
    -e PAI_DISABLE_RAM_CHECK=True \
    -e PAI_AZ_DOCUMENT_INTELLIGENCE_URL=https://<Your service>.cognitiveservices.azure.com/ \
    -e PAI_AZ_DOCUMENT_INTELLIGENCE_KEY=<Your Key> \
    -p 8080:8080 crprivateaiprod.azurecr.io/deid:<version>
    ```

    The above command starts the container with Document Intelligence, for Computer Vision, please replace the above Document Intelligence environment variables with these.

    ```shell Azure Computer Vision Environment Variables theme={"theme":"poimandres"}
    PAI_AZ_COMPUTER_VISION_URL
    PAI_AZ_COMPUTER_VISION_KEY
    ```
  </Step>

  <Step title="(Alternative): Configure Docker Compose File to manipulate the containers including On-Premise Azure OCR container">
    Please see [Limina deid-examples repository - OCR Examples](https://github.com/privateai/deid-examples/tree/main/docker-compose/OCR%20Examples) for more efficient container handling. Sample docker compose files are available including these topics.

    * Option 1 - DEID Container with cloud Azure Computer Vision Service
    * Option 2 - DEID Container with cloud Azure Document Intelligence Service
    * Option 3 - DEID Container with On-Premise Azure Computer Vision Service
  </Step>

  <Step title="Verify Operation">
    Once the containers are running, you can verify their operation by accessing the DEID service's exposed port (e.g., `http://localhost:8080`) and performing a test OCR operation on your documents or images.
  </Step>
</Steps>
