If you haven't heard about Form Recognizer yet, I advise you to have a look at my other posts around Knowledge Mining.

Why would you struggle with running the Docker container locally, when Azure offers multiple ways to host a container? In this article I will show you how to host your labeling tool in a cost effective way using Azure App Service on Linux, including easy to setup security.

Let me show you how to deploy this tool on Azure, in less than 5 minutes.

Azure Portal

Start with creating a new Web App.

  1. Choose the right subscription and resource group.
  2. Name: your preferred name, which will also be used as a subdomain to access the tool
  3. Select Publish: Docker Container
  4. Select Operating System: Linux
  5. Select your preferred region
  6. Change the App Service Plan Sku if this is not set to Basic B1

Press Next: Docker

  1. Select Options: Single Container
  2. Select Image Source: Docker Hub
  3. Image and tag: mcr.microsoft.com/azure-cognitive-services/custom-form/labeltool
  4. Startup Command: eula=accept

Press Review + create

Done! After your App Service has been deployed, you can access the application using the name you specified ending with azurewebsites.net.

CLI

For people who like to automate this process, or if you just don't like a graphical user interface, there is the Azure CLI. You could use the commands below to deploy the service on Azure programatically. Just don't forget to change the placeholders between <>.

az group create --name <resource-group-name> --location "westeurope"

az appservice plan create --name <app-service-plan-name> --resource-group <resource-group-name> --sku B1 --is-linux

az webapp create --resource-group <resource-group-name> --plan <app-service-plan-name> --name <web-app-name> --deployment-container-image-name mcr.microsoft.com/azure-cognitive-services/custom-form/labeltool

az webapp config set --startup-file "eula=accept"

Security

The labeling tool doesn't store any information in a back-end, thus all the credentials for connecting to your blob storage stay on your computer. However, you probably don't want to host a tool for everyone in the world, since you are paying the bill.

It is possible to enable App Service Authentication with Azure Active Directory with a few clicks, where you can limit the usage to everyone in your organisation or to a certain group.

Your App Service has SSL by default, but it is advised to turn the mode to HTTPS only via TLS/SSL settings. Since you are tweaking the settings of your app service now, another advise would be to turn on HTTP version 2.0 in Configuration > General settings.

Costs

Currently my instance is running on a B1 app service plan, which costs about €11 a month!* Since the application offloads most of the processing via javascript to the front-end, you probably won't need a higher app service plan for this workload.

* App Service Basic Linux price has been reduced by 66% through July 31, 2020 as part of an ongoing Linux price promotion. (source)

Quickstart: Label forms, train a model, and analyze a form using the sample labeling tool - Form Recognizer - Azure Cognitive Services
In this quickstart, you’ll use the Form Recognizer sample labeling tool to manually label form documents. Then you’ll train a custom model with the labeled documents and use the model to extract key/value pairs.
More information about the use of the sample labeling tool
microsoft/OCR-Form-Tools
A set of tools to use in Microsoft Azure Form Recognizer and OCR services. - microsoft/OCR-Form-Tools
By the way, the web based labeling tool is open source and can be found here. It has been written in Typescript and is using React + Redux.