IRONSOFTWAREHOME

How to Run & Deploy IronPDF .NET on Azure Function

Curtis Chau
Curtis Chau
Updated: August 2, 2026

Yes. IronPDF can be used to generate, manipulate, and read PDF documents on Azure. IronPDF has been thoroughly tested on multiple Azure platforms including MVC websites, Azure Functions, and many more.


How to Tutorial

Install IronPDF Package

Azure Function Apps have three distinct environments: Linux, Windows, and Container. This article explains how to set up IronPDF in all three environments. Among these, Azure Function App Container is recommended because it provides an isolated environment. To begin, let's select the appropriate package to install.

Azure Function App Container

Azure Function App Container involves minimal hassle, making it the recommended way to deploy IronPDF.

Install-Package IronPdf.Linux

Configure Docker File

Configure the Docker file based on the Linux distribution you are using. Please refer to this article for detailed instructions.

Azure Function App (Windows)

To use the standard IronPDF package, ensure the Run from package file option is unchecked. Enabling this option deploys the project as a ZIP file, which interferes with IronPDF's file configuration. If you prefer to enable the Run from package file option, install the IronPdf.Slim package instead.

PM > Install-Package IronPdf

Azure Function App (Linux)

For Azure Function App (Linux), the project is deployed as a ZIP file by default, and this behavior cannot be disabled. This is similar to enabling the Run from package file option on Azure Function App (Windows).

Install-Package IronPdf.Slim

Select Correct Azure Options

Choosing the Correct Hosting Tier

Azure Basic B1 is the minimum hosting level required for our end users' rendering needs. If you are creating a high throughput system, this may need to be upgraded.

Warning: Note: Failure to select a Plan Type of App service plan may result in IronPDF failing to render PDF documents.
Choosing the correct hosting level Azure Tier

Configuration for .NET 6

Microsoft recently removed imaging libraries from .NET 6+, breaking many legacy APIs. As such, it is necessary to configure your project to still allow these legacy API calls.

  1. On Linux, set Installation.LinuxAndDockerDependenciesAutoConfig=true; to ensure libgdiplus is installed on the machine

  2. Add the following to the .csproj file for your .NET 6 project:

    <GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
    XML
  3. Create a file in your project called runtimeconfig.template.json and populate it with the following:

    {
      "configProperties": {
        "System.Drawing.EnableUnixSupport": true
      }
    }
    JSON
  4. Finally, add the following line to the beginning of your program:

    System.AppContext.SetSwitch("System.Drawing.EnableUnixSupport", true);

Azure Function Code Example

This example is converting HTML to PDF and automatically outputs log entries to the built-in Azure logger (see ILogger log).

[FunctionName("PrintPdf")]
public static async Task<IActionResult> Run(
    [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
    ILogger log, ExecutionContext context)
{
    log.LogInformation("Entered PrintPdf API function...");
    
    // Apply license key
    IronPdf.License.LicenseKey = "IRONPDF-MYLICENSE-KEY-1EF01";

    // Enable logging
    IronPdf.Logging.Logger.LoggingMode = IronPdf.Logging.Logger.LoggingModes.Custom;
    IronPdf.Logging.Logger.CustomLogger = log;

    // Configure IronPdf settings
    IronPdf.Installation.LinuxAndDockerDependenciesAutoConfig = true;
    IronPdf.Installation.AutomaticallyDownloadNativeBinaries = true;
    IronPdf.Installation.ChromeGpuMode = IronPdf.Engines.Chrome.ChromeGpuModes.Disabled;
    IronPdf.Installation.CustomDeploymentDirectory = "/tmp";
    
    try
    {
        log.LogInformation("About to render PDF...");
        ChromePdfRenderer renderer = new ChromePdfRenderer();
        // Render PDF from a URL
        var pdf = renderer.RenderUrlAsPdf("https://www.google.com/");
        log.LogInformation("Finished rendering PDF...");
        return new FileContentResult(pdf.BinaryData, "application/pdf") { FileDownloadName = "google.pdf" };
    }
    catch (Exception e)
    {
        log.LogError(e, "Error while rendering PDF");
        return new OkObjectResult($"Error while rendering PDF: {e}");
    }
}

Creating a project using the Azure Function template in Visual Studio may result in slightly different code. Due to these differences, even with the same package installed, one project might work while the other does not. If this occurs, please set the CustomDeploymentDirectory property to "/tmp".

Understand Each Installation Configuration

  • LinuxAndDockerDependenciesAutoConfig: This setting checks and attempts to download all necessary dependencies for the Chrome Engine. It is required when using non-GUI systems, such as Linux. In container systems, the dependencies are usually listed in the Dockerfile; therefore, you can set this to false.
  • AutomaticallyDownloadNativeBinaries: This option downloads the native Chrome binary at runtime. It is required when using the IronPdf.Slim package.
  • CustomDeploymentDirectory: This setting is required for systems with limited write access.

Known Issues

SVG Fonts Rendering is Not Available on Shared Hosting Plans

One limitation we have found is that the Azure hosting platform does not support servers loading SVG fonts, such as Google Fonts, in their cheaper shared web-app tiers. This is because these shared hosting platforms are not allowed to access windows GDI+ graphics objects for security reasons.

We recommend using a Windows or Linux Docker Container or perhaps a VPS on Azure to navigate this issue where the best font rendering is required.

Azure Free Tier Hosting is Slow

Azure free and shared tiers, and the consumption plan, are not suitable for PDF rendering. We recommend Azure B1 hosting/Premium plan, which is what we use ourselves. The process of HTML to PDF is significant 'work' for any computer - similar to opening and rendering a web page on your own machine. A real browser engine is used, hence we need to provision accordingly and expect similar render times to a desktop machine of similar power.

Creating an Engineering Support Request Ticket

In order to create a request ticket refer to the 'How to Make an Engineering Support Request for IronPDF' guide

Frequently Asked Questions

Can IronPDF be deployed on Azure?

Yes, IronPDF can be deployed on Azure and has been thoroughly tested on various Azure platforms, including MVC websites and Azure Functions.

What hosting tier is recommended for IronPDF on Azure?

Azure Basic B1 is the minimum hosting tier recommended for running IronPDF, but upgrading may be necessary for high throughput systems.

Why should I use Azure Function App Container for IronPDF?

Azure Function App Container is recommended for deploying IronPDF because it offers an isolated environment with minimal hassle, especially when using the IronPdf.Linux package.

What is the best way to convert HTML to PDF with IronPDF on Azure?

To convert HTML to PDF using IronPDF on Azure, you should install the C# library, choose an appropriate hosting plan such as Basic B1 or above, and follow the recommended configuration instructions.

What configuration is necessary for running IronPDF on .NET 6 in Azure?

For .NET 6, configure the `Install.LinuxAndDockerDependenciesAutoConfig` to true, include necessary properties in the `.csproj` file, and create a `runtimeconfig.template.json` to enable Unix support.

How can I ensure proper deployment of IronPDF in Azure Function App (Windows)?

Ensure that the 'Run from package file' option is unchecked or use IronPdf.Slim to avoid file configuration issues during deployment.

What are common issues with IronPDF on Azure shared hosting plans?

Shared hosting plans on Azure do not support loading SVG fonts and may limit IronPDF's graphics capabilities due to restrictions on accessing Windows GDI+ graphics objects.

Is the Azure Free Tier suitable for IronPDF?

No, the Azure Free Tier and shared hosting plans are generally too slow for IronPDF tasks. We recommend utilizing an Azure B1 hosting or Premium plan for better performance.

How can I address deployment differences between Azure Function projects?

If deployment differences arise, ensure that the `CustomDeploymentDirectory` is set to '/tmp', and check for any additional configurations needed for your specific setup.

What logging options are available for IronPDF on Azure?

IronPDF allows logging through Azure's built-in logger by enabling custom logging modes and setting `CustomLogger` to the desired log.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...
Read More

Ready to Get Started?

Nuget Downloads 20,756,830Version:2026.8just released

Get your free 30-day Trial Key instantly.
No credit card or account creation required
C# NuGet Library for PDF
Install with NuGet

Version: 2026.8

PM > Install-Package IronPdf
nuget.org/packages/IronPdf/
  1. In Solution Explorer, right-click References, Manage NuGet Packages
  2. Select Browse and search "IronPdf"
  3. Select the package and install
C# PDF DLL
Download DLL

Version: 2026.8

or download Windows Installer here.

  1. Download and unzip IronPDF to a location such as ~/Libs within your Solution directory
  2. In Visual Studio Solution Explorer, right click References. Select Browse, "IronPdf.dll"

Licenses from $999

Key in blue circle

Get your free 30-day Trial Key instantly.

Your trial license will be sent to your email address

No limitations. 100% unlocked. No credit card.

bullet_checkedNo credit card or account creation requiredNo limitations. 100% unlocked. No credit card.
  • Logo Aetna
  • Logo NASA
  • Logo GE
  • Logo Porsche
  • Logo USDA
  • Logo Qatar
Join Millions of Engineers who’ve tried IronPDF
Book your free Live Demo
Booking Badge

Trusted by Millions of Engineers Worldwide

Iron Software's customer logos
Get Your No-Obligation Consult
Complete the form below or email sales@ironsoftware.com
Your details will always be kept confidential.
Trusted by Millions of Engineers Worldwide
Iron Software's customer logos
Get your free 30-day Trial Key instantly.
No credit card or account creation required