4

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

Murdock
  • 4,352
  • 3
  • 34
  • 63
  • To avoid sandbox issues, you'd need to use something without restrictions (e.g. Virtual Machines). – David Makogon Oct 14 '18 at 21:58
  • Yes sure but then you lose out on the goodies that functions provide. In addition I do not understand why I am getting different results for Functions and Controllers on the same app service plan. – Murdock Oct 14 '18 at 22:01
  • Which version of azure function are you using ? you can get system.draing from nuget package also but everything interacting with the underlying infrastructure will fail by design – Thomas Oct 15 '18 at 08:33
  • v2. I understand that but as I understand the limitation is on App Services in general not on Azure Function specifically. However my code works in the appservice hosted as a web app, but not as an azure function – Murdock Oct 15 '18 at 11:54
  • I can confirm that Web app services do not have this limitation. I have used low level graphics (iOpenCV and Tensorflow) on app services. However, Azure Functions V2 have the limitation of Sandbox. Very basic calls to System.Drawing.Bitmap class will fail with Paltform not supported exception – Sau001 Mar 29 '19 at 16:03

0 Answers0