Can I Run IronXL with .NET on Azure?

Yes, IronXL can be used on Azure to generate QR & Barcodes in C# & VB .NET Applications, and also read Barcodes & QR Codes from scanned images.

IronXL has been thoroughly tested on multiple Azure platforms including MVC websites, Azure Functions, and many more.


Step 1

1. Install IronXL to Get Started

First install with NuGet: https://www.nuget.org/packages/IronXL.Excel

Install-Package IronXL.Excel

How to Tutorial

2. Performance and Azure Tiers

We recommend that Azure B1 hosting levels are very suitable for our end users' Library needs. If they are creating a high throughput system, this may need to be upgraded.

3. Framework Choice

We have found that IronXL for Core and for Framework both work on Azure. .NET Standard applications seem to have a small performance advantage on speed and stability, but use more memory in process.

Azure free tier hosting is slow

Azure free and shared tiers, and the consumption plan, are not suitable for QR processing. We recommend Azure B1 hosting/Premium plan, which is what we use ourselves.

4. Docker on Azure

One way to gain the ability to control performance on Azure is to use IronXL applications and Functions from within Docker Containers.

We have a comprehensive IronXL Azure Docker tutorial for Linux and Windows instances and it is recommended reading.

5. Official Azure Function Support

IronXL supports Azure Function (Azure Functions V3). It hasn't been tested with V4 till now, but it is in our queue.

Working Azure Function Code Example

Tested on Azure Functions v3.3.1.0+. Here is a sample code:

using System.Net;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using IronXL;
using System.Net.Http.Headers;

// This is an Azure Function that processes an HTTP request and returns an Excel file
[FunctionName("excel")]
public static HttpResponseMessage Run(
    [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
    ILogger log)
{
    // Log the processing of the request
    log.LogInformation("C# HTTP trigger function processed a request.");

    // Set the IronXL license key
    IronXL.License.LicenseKey = "Key";

    // Load an existing workbook
    var workBook = WorkBook.Load("test-wb.xlsx");

    // Create a response with the workbook content as an attachment
    var result = new HttpResponseMessage(HttpStatusCode.OK);
    result.Content = new ByteArrayContent(workBook.ToByteArray());
    result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
    { 
        FileName = $"{DateTime.Now:yyyyMMddmm}.xlsx" 
    };
    result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");

    // Return the response
    return result;
}
using System.Net;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using IronXL;
using System.Net.Http.Headers;

// This is an Azure Function that processes an HTTP request and returns an Excel file
[FunctionName("excel")]
public static HttpResponseMessage Run(
    [HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequest req,
    ILogger log)
{
    // Log the processing of the request
    log.LogInformation("C# HTTP trigger function processed a request.");

    // Set the IronXL license key
    IronXL.License.LicenseKey = "Key";

    // Load an existing workbook
    var workBook = WorkBook.Load("test-wb.xlsx");

    // Create a response with the workbook content as an attachment
    var result = new HttpResponseMessage(HttpStatusCode.OK);
    result.Content = new ByteArrayContent(workBook.ToByteArray());
    result.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
    { 
        FileName = $"{DateTime.Now:yyyyMMddmm}.xlsx" 
    };
    result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");

    // Return the response
    return result;
}
Imports System.Net
Imports Microsoft.Azure.WebJobs
Imports Microsoft.Azure.WebJobs.Extensions.Http
Imports Microsoft.AspNetCore.Http
Imports Microsoft.Extensions.Logging
Imports IronXL
Imports System.Net.Http.Headers

' This is an Azure Function that processes an HTTP request and returns an Excel file
<FunctionName("excel")>
Public Shared Function Run(<HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route := Nothing)> ByVal req As HttpRequest, ByVal log As ILogger) As HttpResponseMessage
	' Log the processing of the request
	log.LogInformation("C# HTTP trigger function processed a request.")

	' Set the IronXL license key
	IronXL.License.LicenseKey = "Key"

	' Load an existing workbook
	Dim workBook = WorkBook.Load("test-wb.xlsx")

	' Create a response with the workbook content as an attachment
	Dim result = New HttpResponseMessage(HttpStatusCode.OK)
	result.Content = New ByteArrayContent(workBook.ToByteArray())
	result.Content.Headers.ContentDisposition = New ContentDispositionHeaderValue("attachment") With {.FileName = $"{DateTime.Now:yyyyMMddmm}.xlsx"}
	result.Content.Headers.ContentType = New MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")

	' Return the response
	Return result
End Function
$vbLabelText   $csharpLabel

Frequently Asked Questions

Can I run IronXL with .NET on Azure?

Yes, IronXL can be used on Azure to generate QR & Barcodes in C# & VB .NET Applications, and also read Barcodes & QR Codes from scanned images.

What Azure hosting level is recommended for IronXL?

We recommend that Azure B1 hosting levels are very suitable for our end users' Library needs. For high throughput systems, an upgrade may be necessary.

Which .NET framework should I choose for IronXL on Azure?

IronXL works on both .NET Core and .NET Framework on Azure. However, .NET Standard applications have a small performance advantage in speed and stability but use more memory.

Is Azure free tier suitable for QR processing with IronXL?

No, Azure free and shared tiers, along with the consumption plan, are not suitable for QR processing. We recommend Azure B1 hosting or a Premium plan.

Can I use Docker with IronXL on Azure?

Yes, using IronXL applications and Functions within Docker Containers can help control performance on Azure. A comprehensive tutorial is available for Linux and Windows instances.

Does IronXL support Azure Functions?

Yes, IronXL supports Azure Functions V3. It hasn't been tested with V4 yet, but it is in our queue.

How can I install IronXL for Azure?

You can install IronXL using NuGet with the command: nuget install IronXL.Excel.

Is there a working example of IronXL with Azure Functions?

Yes, there is a sample code for an Azure Function that processes an HTTP request and returns an Excel file, tested on Azure Functions v3.3.1.0+.