Azure Function - error running OpenHtmlToPdf in a Linux App Service plan

David Finley 31 Reputation points
2020-05-31T19:12:31.553+00:00

've created an Azure Function that uses OpenHtmlToPdf to convert HTML to PDF. It works fine locally and in a Windows App Service plan, but if I try to run it in a Linux App Service plan I get the below error.

System.ComponentModel.Win32Exception (13): Permission denied at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec) at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at OpenHtmlToPdf.HtmlToPdfConverterProcess.Convert(ConversionSource conversionSource) at OpenHtmlToPdf.Pdf.DocumentBuilder.ReadContentUsingTemporaryFile(String temporaryFilename) at GeneratePDF.GeneratePDF.Run(HttpRequestMessage req, Stream quotepdf, ILogger log) in C:\Users\David\Source\Repos\PDFTest\PdfTest.cs:line 151

Is my function code only compatible with Windows?

Thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,911 questions
{count} votes

1 answer

Sort by: Most helpful
  1. QuantumCache 20,366 Reputation points Moderator
    2020-07-13T15:00:03.13+00:00

    Hi @DavidFinley-2155 ,Please visit Limitations on Introduction to Azure App Service on Linux.

    The Azure portal shows only features that currently work for Web App for Containers. As we enable more features, they will become visible on the portal.
    App Service on Linux is only supported with Free, Basic, Standard, Premium and Isolated app service plans and does not have a Shared tier. You cannot create a Linux Web App in an App Service plan already hosting non-Linux Web Apps.

    Based on a current limitation, for the same resource group you cannot mix Windows and Linux apps in the same region.

    Also please visit Create an ASP.NET Core app in App Service on Linux as a reference.

    Please let us know if you have any further questions in this matter.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.