Forum Discussion
Ryan Stone
Apr 01, 2020Iron Contributor
PDF generation in Azure App Service
I'm looking for a solid option for PDF generation that is compatible with running within the constraints of Azure App Service or Azure Functions. I know of several options but am curious what others...
Jamony
Jun 27, 2026MCT
For reliable PDF generation on Azure, I would choose the hosting model based on what the PDF library needs.
If the library depends on a browser engine or native OS packages, the most reliable pattern is usually a Linux custom container running on App Service, Azure Container Apps, or Functions Premium/custom container. That lets you install Chromium/wkhtmltopdf/native dependencies in the image and test the exact runtime.
A few practical recommendations:
- Avoid libraries that depend on Windows desktop/GDI-style APIs in the App Service sandbox.
- For HTML-to-PDF, headless Chromium through Playwright/Puppeteer can work well, but package it in a Linux container with all dependencies installed.
- For Azure Functions, avoid Consumption plan for heavy PDF rendering. Premium or Dedicated is usually safer because of timeout, memory, cold start, and native dependency concerns.
- Put PDF jobs behind a queue if generation can take time, and write output to Blob Storage rather than relying on local disk.
- If PDF fidelity is business-critical, consider a managed PDF service/API to avoid maintaining browser/runtime dependencies yourself.
So my default choice today would be a containerized worker or App Service Linux container for predictable dependencies, not plain Functions Consumption.
Docs:
https://learn.microsoft.com/azure/app-service/configure-custom-container
https://learn.microsoft.com/azure/azure-functions/functions-scale