|
| 1 | +--- |
| 2 | +title: Use personally identifiable information Docker containers on-premises |
| 3 | +titleSuffix: Azure AI services |
| 4 | +description: Use Docker containers for the Personally Identifiable Information API to determine the language of written text, on-premises. |
| 5 | +#services: cognitive-services |
| 6 | +author: jboback |
| 7 | +manager: nitinme |
| 8 | +ms.service: azure-ai-language |
| 9 | +ms.custom: |
| 10 | +ms.topic: how-to |
| 11 | +ms.date: 10/07/2024 |
| 12 | +ms.author: jboback |
| 13 | +keywords: on-premises, Docker, container |
| 14 | +--- |
| 15 | + |
| 16 | +# Install and run Personally Identifiable Information containers |
| 17 | + |
| 18 | +Containers enable you to host the Personally Identifiable Information API on your own infrastructure. If you have security or data governance requirements that can't be fulfilled by calling Personally Identifiable Information remotely, then containers might be a good option. |
| 19 | + |
| 20 | +If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/cognitive-services/) before you begin. |
| 21 | + |
| 22 | +## Prerequisites |
| 23 | + |
| 24 | +You must meet the following prerequisites before using Personally Identifiable Information containers. |
| 25 | + |
| 26 | +* If you don't have an Azure subscription, create a [free account](https://azure.microsoft.com/free/cognitive-services/). |
| 27 | +* [Docker](https://docs.docker.com/) installed on a host computer. Docker must be configured to allow the containers to connect with and send billing data to Azure. |
| 28 | + * On Windows, Docker must also be configured to support Linux containers. |
| 29 | + * You should have a basic understanding of [Docker concepts](https://docs.docker.com/get-started/overview/). |
| 30 | +* A <a href="https://portal.azure.com/#create/Microsoft.CognitiveServicesTextAnalytics" title="Create a Language resource" target="_blank">Language resource </a> |
| 31 | + |
| 32 | +[!INCLUDE [Gathering required parameters](../../../containers/includes/container-gathering-required-parameters.md)] |
| 33 | + |
| 34 | +## Host computer requirements and recommendations |
| 35 | + |
| 36 | +[!INCLUDE [Host Computer requirements](../../../includes/cognitive-services-containers-host-computer.md)] |
| 37 | + |
| 38 | +The following table describes the minimum and recommended specifications for the available container. Each CPU core must be at least 2.6 gigahertz (GHz) or faster. |
| 39 | + |
| 40 | +It is recommended to have a CPU with AVX-512 instruction set, for the best experience (performance and accuracy). |
| 41 | + |
| 42 | +| | Minimum host specs | Recommended host specs | |
| 43 | +|-------------------------------------------|------------------------|------------------------| |
| 44 | +| **Personally Identifiable Information** | 1 core, 2GB memory | 4 cores, 8GB memory | |
| 45 | + |
| 46 | +CPU core and memory correspond to the `--cpus` and `--memory` settings, which are used as part of the `docker run` command. |
| 47 | + |
| 48 | +## Get the container image with `docker pull` |
| 49 | + |
| 50 | +The Personally Identifiable Information container image can be found on the `mcr.microsoft.com` container registry syndicate. It resides within the `azure-cognitive-services/textanalytics/` repository and is named `pii`. The fully qualified container image name is, `mcr.microsoft.com/azure-cognitive-services/textanalytics/pii` |
| 51 | + |
| 52 | + To use the latest version of the container, you can use the `latest` tag, which is for English. You can also find a full list of containers for supported languages using the [tags on the MCR](https://mcr.microsoft.com/product/azure-cognitive-services/textanalytics/pii/tags). |
| 53 | + |
| 54 | +The latest Personally Identifiable Information container is available in several languages. To download the container for the English container, use the command below. |
| 55 | + |
| 56 | +``` |
| 57 | +docker pull mcr.microsoft.com/azure-cognitive-services/textanalytics/pii:latest |
| 58 | +``` |
| 59 | + |
| 60 | +[!INCLUDE [Tip for using docker list](../../../includes/cognitive-services-containers-docker-list-tip.md)] |
| 61 | + |
| 62 | +## Run the container with `docker run` |
| 63 | + |
| 64 | +Once the container is on the host computer, use the [docker run](https://docs.docker.com/engine/reference/commandline/run/) command to run the containers. The container will continue to run until you stop it. Replace the placeholders below with your own values: |
| 65 | + |
| 66 | + |
| 67 | +> [!IMPORTANT] |
| 68 | +> * 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. |
| 69 | +> * The `Eula`, `Billing`, and `ApiKey` options must be specified to run the container; otherwise, the container won't start. For more information, see [Billing](#billing). |
| 70 | +
|
| 71 | +To run the Personally Identifiable Information container, execute the following `docker run` command. Replace the placeholders below with your own values: |
| 72 | + |
| 73 | +| Placeholder | Value | Format or example | |
| 74 | +|-------------|-------|---| |
| 75 | +| **{API_KEY}** | The key for your Language resource. You can find it on your resource's **Key and endpoint** page, on the Azure portal. |`xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`| |
| 76 | +| **{ENDPOINT_URI}** | The endpoint for accessing the API. You can find it on your resource's **Key and endpoint** page, on the Azure portal. | `https://<your-custom-subdomain>.cognitiveservices.azure.com` | |
| 77 | +| **{IMAGE_TAG}** | The image tag representing the language of the container you want to run. Make sure this matches the `docker pull` command you used. | `latest` | |
| 78 | + |
| 79 | +```bash |
| 80 | +docker run --rm -it -p 5000:5000 --memory 8g --cpus 1 \ |
| 81 | +mcr.microsoft.com/azure-cognitive-services/textanalytics/pii:{IMAGE_TAG} \ |
| 82 | +Eula=accept \ |
| 83 | +Billing={ENDPOINT_URI} \ |
| 84 | +ApiKey={API_KEY} |
| 85 | +``` |
| 86 | + |
| 87 | +This command: |
| 88 | + |
| 89 | +* Runs a *Personally Identifiable Information* container from the container image |
| 90 | +* Allocates one CPU core and 8 gigabytes (GB) of memory |
| 91 | +* Exposes TCP port 5000 and allocates a pseudo-TTY for the container |
| 92 | +* Automatically removes the container after it exits. The container image is still available on the host computer. |
| 93 | + |
| 94 | +[!INCLUDE [Running multiple containers on the same host](../../../includes/cognitive-services-containers-run-multiple-same-host.md)] |
| 95 | + |
| 96 | +## Query the container's prediction endpoint |
| 97 | + |
| 98 | +The container provides REST-based query prediction endpoint APIs. |
| 99 | + |
| 100 | +Use the host, `http://localhost:5000`, for container APIs. |
| 101 | + |
| 102 | +<!-- ## Validate container is running --> |
| 103 | + |
| 104 | +[!INCLUDE [Container's API documentation](../../../includes/cognitive-services-containers-api-documentation.md)] |
| 105 | + |
| 106 | +For information on how to call PII see [our guide](../how-to-call.md). |
| 107 | + |
| 108 | +## Run the container disconnected from the internet |
| 109 | + |
| 110 | +[!INCLUDE [configure-disconnected-container](../../../containers/includes/configure-disconnected-container.md)] |
| 111 | + |
| 112 | +## Stop the container |
| 113 | + |
| 114 | +[!INCLUDE [How to stop the container](../../../includes/cognitive-services-containers-stop.md)] |
| 115 | + |
| 116 | +## Troubleshooting |
| 117 | + |
| 118 | +If you run the container with an output [mount](../../concepts/configure-containers.md#mount-settings) and logging enabled, the container generates log files that are helpful to troubleshoot issues that happen while starting or running the container. |
| 119 | + |
| 120 | +[!INCLUDE [Azure AI services FAQ note](../../../containers/includes/cognitive-services-faq-note.md)] |
| 121 | + |
| 122 | +## Billing |
| 123 | + |
| 124 | +The Personally Identifiable Information containers send billing information to Azure, using a _Language_ resource on your Azure account. |
| 125 | + |
| 126 | +[!INCLUDE [Container's Billing Settings](../../../includes/cognitive-services-containers-how-to-billing-info.md)] |
| 127 | + |
| 128 | +For more information about these options, see [Configure containers](../../concepts/configure-containers.md). |
| 129 | + |
| 130 | +## Summary |
| 131 | + |
| 132 | +In this article, you learned concepts and workflow for downloading, installing, and running Personally Identifiable Information containers. In summary: |
| 133 | + |
| 134 | +* Personally Identifiable Information provides Linux containers for Docker |
| 135 | +* Container images are downloaded from the Microsoft Container Registry (MCR). |
| 136 | +* Container images run in Docker. |
| 137 | +* You must specify billing information when instantiating a container. |
| 138 | + |
| 139 | +> [!IMPORTANT] |
| 140 | +> Azure AI containers are not licensed to run without being connected to Azure for metering. Customers need to enable the containers to communicate billing information with the metering service at all times. Azure AI containers do not send customer data (e.g. text that is being analyzed) to Microsoft. |
| 141 | +
|
| 142 | +## Next steps |
| 143 | + |
| 144 | +* See [Configure containers](../../concepts/configure-containers.md) for configuration settings. |
0 commit comments