The example code for converting HTML to PDF using Blink in a Linux docker container fails in an Azure App Service. It works locally but fails in an Azure App Service. The service plan being used is Premium V2 P1v2.
The following exception is thrown:
Syncfusion.Pdf.PdfException: Failed to convert webpage
at Syncfusion.HtmlConverter.BlinkConverter.ConvertToPdf(String url, PdfDocument& document)
at Syncfusion.HtmlConverter.BlinkConverter.<>c__DisplayClass161_0.<Convert>b__0()
Source Code
https://www.syncfusion.com/downloads/support/directtrac/general/ze/BlinkLinuxDockerV3.1530181728
Taken from: https://www.syncfusion.com/kb/11299/how-to-convert-html-to-pdf-using-blink-in-linux-docker
Here is the yaml for our deployment pipeline:
We created an Azure Devops pipeline that corresponds to the yaml I supplied above and manually ran it. The pipeline pulls the code from the SyncFusion sample repo, builds it, and pushes the resulting image to an Azure container registry. The container was then manually deployed to an Azure app service.
We deployed again to a P2V2 service plan with the same results.
P2V2 => 2 cores, 7GB RAM, 250GB storage
We are able to build and deploy it manually with VS 2019 (Windows) successfully.
Had the exact same scenario, however we are using the Syncfusion.WebKitWrapper instead of Blink.
Either way, Visual Studio publishing the container to the ACR worked fine but the Azure Pipeline did not, giving us a permission error.
We found when inspecting the images, that the /app/QtBinaries/QtBinariesLinux/Syncfusion.WebKitWrapper file would have execute permission on the image created by Visual Studio publish, but it would not have execute permission on the image created by the Azure Pipeline.
Added this near the end of our DOCKERFILE and it started working....
RUN chmod 777 /app/QtBinaries/QtBinariesLinux/Syncfusion.WebKitWrapper
Thought I would share, as it might help to inspect your file permissions on the images that Azure Pipelines generates.