System.Drawing is not supported on this platform o

2019-06-27 09:28发布

问题:

I have read the following answer.

It states that App Service sandboxing has some restrictions

Win32k.sys (User32/GDI32) Restrictions

For the sake of radical attack surface area reduction, the sandbox prevents almost all of the Win32k.sys APIs from being called, which practically means that most of User32/GDI32 system calls are blocked. For most applications this is not an issue since most Azure Web Apps do not require access to Windows UI functionality (they are web applications after all).

However I have some image resizing logic (using the EPplus excel library) that works in a normal asp.net core controller but fails in an Azure function (hosted in the exact same app service plan running on the Basic tier) with the message:

System.Drawing is not supported on this platform on Azure Function

Is there any other additional restriction unrelated to the Web App Sandbox. eg nuances between wep apps and azure function apps.

We wanted to use Azure Function to generate all our excel reports however this seems impossible now. Is there any other options? I even tried Amazon Lambda but I ran into this issue: https://github.com/JanKallman/EPPlus/issues/83