Click or drag to resize

Deployment to Azure App Service

ExpertPdf Anywhere runs on Azure App Service on Windows and on Linux, on the Basic plan or above, with the complete feature set. Free and Shared plans are not supported. The web application is deployed as it is: nothing is installed on the server and no setting is required.

Packages

App Service

Packages

Publish

Windows

ExpertPdf.Anywhere.Windows (or ExpertPdf.Anywhere and ExpertPdf.Anywhere.Native.win-x64)

Web Deploy or zip deploy

Linux

ExpertPdf.Anywhere.Linux (or ExpertPdf.Anywhere and ExpertPdf.Anywhere.Native.linux-x64), ExpertPdf.Anywhere.Fonts

zip deploy (Web Deploy is not available on Linux)

The Linux image of App Service has no fonts for Chinese, Japanese and Korean, and a code deployment cannot install any, so reference the fonts package for Linux. A Linux application can be built and published from Windows: the native package carries every library the engine needs, and ExpertPdf Anywhere restores the engine's execute permission, which a zip deployment loses.

Step by step

The steps use the Azure CLI; the Azure portal offers the same choices (Create a resource > Web App). An App Service plan is created for Windows or for Linux and cannot be changed later.

1. Create a resource group and a plan. Premium v3 gives the fastest conversions (see Performance below); add --is-linux for a Linux plan:

az login
az group create --name expertpdf-rg --location westeurope
az appservice plan create --resource-group expertpdf-rg \
    --name expertpdf-plan --sku P1v3 --is-linux

2. Create the web app with the .NET 10 runtime - DOTNETCORE:10.0 on Linux, dotnet:10 on Windows:

az webapp create --resource-group expertpdf-rg --plan expertpdf-plan \
    --name expertpdf-web --runtime "DOTNETCORE:10.0"

3. Apply two settings.Always On keeps the application loaded while idle, so the Chromium engine stays warm and a request never meets a starting worker. On Windows, also use a 64-bit worker process: a new Windows web app starts as 32-bit.

az webapp config set --resource-group expertpdf-rg --name expertpdf-web \
    --always-on true --use-32bit-worker-process false

4. Publish and deploy the application as a zip file:

dotnet publish -c Release -o publish
cd publish && zip -r ../app.zip . && cd ..
az webapp deploy --resource-group expertpdf-rg --name expertpdf-web \
    --src-path app.zip --type zip

On Windows, create the zip with Compress-Archive publish\* app.zip. From Visual Studio, use Publish > Azure > Azure App Service (Windows or Linux) instead.

5. Open the application at https://expertpdf-web.azurewebsites.net.

Do not use Run From Package on Windows
Important note  Important

With the WEBSITE_RUN_FROM_PACKAGE setting, App Service mounts the deployment zip as wwwroot instead of extracting it, and the engine cannot be started from that mount. Every conversion then fails with "Chromium engine process failed (exit code -1073741515) and no output JSON was produced" - the Windows status STATUS_DLL_NOT_FOUND: the engine's libraries are in the package, but cannot be loaded from it.

Remove the setting and deploy normally; zip deploy and Web Deploy extract the application into a writable wwwroot. In Visual Studio, leave Run from package file unselected in the publish profile.

If Run From Package has to stay, copy the engine folder (Chromium-CEF-154.0.28) to a writable folder such as %HOME%\site\engine when the application starts, and set CefEnginePath to the copy. App Service for Linux ignores the setting for a code application, so Linux is not affected.

Performance and choosing a plan

HTML conversion runs a complete browser and is processor bound, so the plan decides the speed:

Plan

Use

Premium v3 (P1v3 and up)

the plan to choose when conversion time matters

Basic or Standard (for example S1)

occasional or background conversions

Tested in West Europe on Windows and Linux. An S1 instance has a single virtual core; Premium v3 gives a conversion more processor.

Leave WebGlEnabled off (the default) unless your pages draw with WebGL.

Windows worker bitness

A 32-bit worker process can use the win-x64 package: the engine then runs in a process of its own. With the win-x86 package a 32-bit worker keeps the engine loaded. A 64-bit worker with win-x64 is the recommended combination.

Sample

Deploy the web sample of the ExpertPdf Anywhere samples (windows/Web or linux/Web) to try it: it converts pages, HTML and files with every option of the library.

See Also