containersazure-cognitive-servicespodmanazure-form-recognizer

How do you change the port of Microsoft Form Recognizer on-premise?


Microsoft Azure Form Recognizer as part of Cognitive Services can run in a container:

pull docker://mcr.microsoft.com/azure-cognitive-services/form-recognizer/layout

You can run the container on the default port 5000.

But when you open a pod in podman with several ports. The MS form recognizer grabs all open ports 5000+. We would like to allow only one or two ports for this service.

podman pod create --name=my_pod  -p 5000:5000 -p 5002:5002 -p 5008:8888 

You can run and define the incoming ports with a command like this:

podman run --rm -it -d --name myFormRecognizer -p 5000:5000 --memory 16g --cpus 4 mcr.microsoft.com/azure-cognitive-services/vision/read:3.2-model-2022-04-30 Eula=accept Billing=https://cs-container.cognitiveservices.azure.com/ ApiKey=XXXX

But when using pods, ports are already defined when creating the pod. Thus the p-switch is not available running the container.

Is there a method to prevent MS Forms container using specific ports? Our workaround today is, running other services first, and MS forms last, when starting the pod.


Solution

  • I'm new in Podman and Form Recognizer, so my understanding may not be correct.
    But I've done by setting the layout to use port 5010 to connect from outside by command below:

    # Create Pod
    podman pod create --name my_pod --share ipc,uts
    # Start layout container inside the pod
    podman run --name layout --restart=unless-stopped --pod my_pod -p 5010:5000 -d -e EULA='accept' -e 'billing=<Your_Billing_Endpoint>' -e apiKey='<Your_API_Key>' -v shared:/shared -v output:/logs mcr.microsoft.com/azure-cognitive-services/form-recognizer/layout-3.0 
    

    You may try and see if it fit what you expected