Configure Language Understanding Docker containers

The Language Understanding (LUIS) container runtime environment is configured using the docker run command arguments. LUIS has several required settings, along with a few optional settings. Several examples of the command are available. The container-specific settings are the input mount settings and the billing settings.

Configuration settings

This container has the following configuration settings:

Required Setting Purpose
Yes ApiKey Used to track billing information.
No ApplicationInsights Allows you to add Azure Application Insights telemetry support to your container.
Yes Billing Specifies the endpoint URI of the service resource on Azure.
Yes Eula Indicates that you've accepted the license for the container.
No Fluentd Write log and, optionally, metric data to a Fluentd server.
No Http Proxy Configure an HTTP proxy for making outbound requests.
No Logging Provides ASP.NET Core logging support for your container.
Yes Mounts Read and write data from host computer to container and from container back to host computer.

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.

ApiKey setting

The ApiKey setting specifies the Azure 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 Cognitive Services resource specified for the Billing configuration setting.

This setting can be found in the following places:

  • Azure portal: Cognitive Services Resource Management, under Keys
  • LUIS portal: Keys and Endpoint settings page.

Do not use the starter key or the authoring key.

ApplicationInsights setting

The ApplicationInsights setting allows you to add Azure Application Insights telemetry support to your container. Application Insights provides in-depth monitoring of your container. You can easily monitor your container for availability, performance, and usage. You can also quickly identify and diagnose errors in your container.

The following table describes the configuration settings supported under the ApplicationInsights section.

Required Name Data type Description
No InstrumentationKey String The instrumentation key of the Application Insights instance to which telemetry data for the container is sent. For more information, see Application Insights for ASP.NET Core.

Example:
InstrumentationKey=123456789

Billing setting

The Billing setting specifies the endpoint URI of the Cognitive 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 a Cognitive Services resource on Azure. The container reports usage about every 10 to 15 minutes.

This setting can be found in the following places:

  • Azure portal: Cognitive Services Overview, labeled Endpoint
  • LUIS portal: Keys and Endpoint settings page, as part of the endpoint URI.

Remember to include the luis/v2.0 routing in the URL as shown in the following table:

Required Name Data type Description
Yes Billing String Billing endpoint URI

Example:
Billing=https://westus.api.cognitive.microsoft.com/luis/v2.0

Eula setting

The Eula setting indicates that you've accepted the license for the container. You must specify a value for this configuration setting, and the value must be set to accept.

Required Name Data type Description
Yes Eula String License acceptance

Example:
Eula=accept

Cognitive Services containers are licensed under your agreement governing your use of Azure. If you do not have an existing agreement governing your use of Azure, you agree that your agreement governing use of Azure is the Microsoft Online Subscription Agreement, which incorporates the Online Services Terms. For previews, you also agree to the Supplemental Terms of Use for Microsoft Azure Previews. By using the container you agree to these terms.

Fluentd settings

Fluentd is an open-source data collector for unified logging. The Fluentd settings manage the container's connection to a Fluentd server. The container includes a Fluentd logging provider, which allows your container to write logs and, optionally, metric data to a Fluentd server.

The following table describes the configuration settings supported under the Fluentd section.

Name Data type Description
Host String The IP address or DNS host name of the Fluentd server.
Port Integer The port of the Fluentd server.
The default value is 24224.
HeartbeatMs Integer The heartbeat interval, in milliseconds. If no event traffic has been sent before this interval expires, a heartbeat is sent to the Fluentd server. The default value is 60000 milliseconds (1 minute).
SendBufferSize Integer The network buffer space, in bytes, allocated for send operations. The default value is 32768 bytes (32 kilobytes).
TlsConnectionEstablishmentTimeoutMs Integer The timeout, in milliseconds, to establish a SSL/TLS connection with the Fluentd server. The default value is 10000 milliseconds (10 seconds).
If UseTLS is set to false, this value is ignored.
UseTLS Boolean Indicates whether the container should use SSL/TLS for communicating with the Fluentd server. The default value is false.

Http proxy credentials settings

If you need to configure an HTTP proxy for making outbound requests, use these two arguments:

Name Data type Description
HTTP_PROXY string the proxy to use, for example, http://proxy:8888
HTTP_PROXY_CREDS string any credentials needed to authenticate against the proxy, for example, username:password.
docker run --rm -it -p 5000:5000 \
--memory 2g --cpus 1 \
--mount type=bind,src=/home/azureuser/output,target=/output \
<registry-location>/<image-name> \
Eula=accept \
Billing=<billing-endpoint> \
ApiKey=<api-key> \
HTTP_PROXY=http://190.169.1.6:3128 \
HTTP_PROXY_CREDS=jerry:123456 \

Logging settings

The Logging settings manage ASP.NET Core logging support for your container. You can use the same configuration settings and values for your container that you use for an ASP.NET Core application.

The following logging providers are supported by the container:

Provider Purpose
Console The ASP.NET Core Console logging provider. All of the ASP.NET Core configuration settings and default values for this logging provider are supported.
Debug The ASP.NET Core Debug logging provider. All of the ASP.NET Core configuration settings and default values for this logging provider are supported.
Disk The JSON logging provider. This logging provider writes log data to the output mount.

This container command stores logging information in the JSON format to the output mount:

docker run --rm -it -p 5000:5000 \
--memory 2g --cpus 1 \
--mount type=bind,src=/home/azureuser/output,target=/output \
<registry-location>/<image-name> \
Eula=accept \
Billing=<billing-endpoint> \
ApiKey=<api-key> \
Logging:Disk:Format=json

This container command shows debugging information, prefixed with dbug, while the container is running:

docker run --rm -it -p 5000:5000 \
--memory 2g --cpus 1 \
<registry-location>/<image-name> \
Eula=accept \
Billing=<billing-endpoint> \
ApiKey=<api-key> \
Logging:Console:LogLevel:Default=Debug

Disk logging

The Disk logging provider supports the following configuration settings:

Name Data type Description
Format String The output format for log files.
Note: This value must be set to json to enable the logging provider. If this value is specified without also specifying an output mount while instantiating a container, an error occurs.
MaxFileSize Integer The maximum size, in megabytes (MB), of a log file. When the size of the current log file meets or exceeds this value, a new log file is started by the logging provider. If -1 is specified, the size of the log file is limited only by the maximum file size, if any, for the output mount. The default value is 1.

For more information about configuring ASP.NET Core logging support, see Settings file configuration.

Mount 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 LUIS container doesn'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 may not be accessible due to a conflict between permissions used by the docker service account and the host mount location permissions.

The following table describes the settings supported.

Required Name Data type Description
Yes Input String The target of the input mount. The default value is /input. This is the location of the LUIS package files.

Example:
--mount type=bind,src=c:\input,target=/input
No Output String The target of the output mount. The default value is /output. This is the location of the logs. This includes LUIS query logs and container logs.

Example:
--mount type=bind,src=c:\output,target=/output

Example docker run commands

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 are very familiar with docker containers.

Remember to include the luis/v2.0 routing in the URL as shown in the following table.

Replace {argument_name} with your own values:

Placeholder Value Format or example
{ENDPOINT_KEY} The endpoint key of the trained LUIS application. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
{BILLING_ENDPOINT} The billing endpoint value is available on the Azure Cognitive Services Overview page. https://westus.api.cognitive.microsoft.com/luis/v2.0

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 Keys and Endpoints page in the LUIS portal and is also available on the Azure Cognitive Services resource keys page.

Basic example

The following example has the fewest arguments possible to run the container:

docker run --rm -it -p 5000:5000 --memory 4g --cpus 2 \
--mount type=bind,src=c:\input,target=/input \
--mount type=bind,src=c:\output,target=/output \
mcr.microsoft.com/azure-cognitive-services/luis:latest \
Eula=accept \
Billing={BILLING_ENDPOINT} \
ApiKey={ENDPOINT_KEY}

Note

The preceding command uses the directory off the c: drive to avoid any permission conflicts on Windows. If you need to use a specific directory as the input directory, you may need to grant the docker service permission. The preceding docker command uses the back slash, \, as a line continuation character. Replace or remove this based on your host computer operating system's requirements. Do not change the order of the arguments unless you are very familiar with docker containers.

ApplicationInsights example

The following example sets the ApplicationInsights argument to send telemetry to Application Insights while the container is running:

docker run --rm -it -p 5000:5000 --memory 6g --cpus 2 \
--mount type=bind,src=c:\input,target=/input \
--mount type=bind,src=c:\output,target=/output \
mcr.microsoft.com/azure-cognitive-services/luis:latest \
Eula=accept \
Billing={BILLING_ENDPOINT} \
ApiKey={ENDPOINT_KEY}
InstrumentationKey={INSTRUMENTATION_KEY}

Logging example

The following command sets the logging level, Logging:Console:LogLevel, to configure the logging level to Information.

docker run --rm -it -p 5000:5000 --memory 6g --cpus 2 \
--mount type=bind,src=c:\input,target=/input \
--mount type=bind,src=c:\output,target=/output \
mcr.microsoft.com/azure-cognitive-services/luis:latest \
Eula=accept \
Billing={BILLING_ENDPOINT} \
ApiKey={ENDPOINT_KEY} \
Logging:Console:LogLevel:Default=Information

Next steps