Azure Functions
Deploy a Function App that certifies PDFs with the SecureExchanges.Signature.NetCore module.
Chromium cannot run in the Azure Functions sandbox on Windows: the deployment must target a Linux container on a Premium plan. The Dockerfile and Chromium's dependencies are described in Docker and Linux; this page covers the Azure configuration.
Prerequisites
- An Azure Functions Premium plan, in Linux container mode.
- An Azure Container Registry: the Basic tier is enough for one image.
- A system-assigned managed identity on the Function App, with the AcrPull role on the registry.
- An image built with the Dockerfile from Docker and Linux.
Tip
A complete project is available on GitHub: AzureFunctionsSignature.netCore.
Steps
- Create an Azure Container Registry, in the same region as the Function App. The registry admin account is not needed with a managed identity: leave it disabled.
- Build the image with the Dockerfile from Docker and Linux.
az acr buildbuilds the image in Azure, without Docker on your workstation. - Enable the Function App's managed identity, grant it the AcrPull role on the registry, then configure the Function App to use that identity to pull the image.
- Point the Function App to the image.
- Restart the Function App: it pulls the image and starts.
Application settings
| Setting | Value | Why |
|---|---|---|
SE_DISABLE_AUTO_DOWNLOAD |
1 |
Chromium is in the image: no download at runtime. |
FUNCTIONS_WORKER_PROCESS_COUNT |
1 |
A single Chromium process per instance: less memory, especially on the EP1 plan. |
Warning
Secure Exchanges credentials. Do not put them in the image or in plain text in the application settings. Read them at runtime from Azure Key Vault with the Function App's managed identity, and grant it read access only to the secrets it needs. See Credentials and environments.
Common errors
| Symptom | Likely cause | Solution |
|---|---|---|
| Chromium does not start | Function App on Windows, or image without Chromium's dependencies | Use a Linux container built with the Dockerfile from Docker and Linux. |
| The Function App does not pull the image | Missing AcrPull role, or identity not configured for the registry | Check step 3. |
| Very slow first call | Chromium downloaded at runtime | Check that SE_DISABLE_AUTO_DOWNLOAD is 1 and that the image contains Chromium. |