VCRedist 2015+ on Azure Functions

283 views Asked by At

I would like to run an exe file that was created inhouse on an Azure Function app. It does some processing that needs Visual C++ redistributables 2015, however that is not installed in the virtual machine the function runs on, it only comes with 2012 (I used reg query to find this out). Is there a way to make the executable run properly?

I have tried copying some required dlls on the same folder as my exe and adding the path to the environment variable %PATH%, this did not work on Functions but did work on a regular VM (probably because of the sandbox nature of the Functions VM).

2

There are 2 answers

0
Alejandro B. On BEST ANSWER

I was able to make this work. I was running the application from a .bat file which did very little but one of the things was meddling with the PATH. I commented that out and still not worked, so I runn the app straight from the .exe file and that, along with having the needed vc redist dlls (4 of them) in the same folder did the trick. It turned out though that running the app in the conditions I needed (Premium plan with pre-warmed instance) was more expensive than using Azure Batch and most likely than having a dedicated VM, both of wich make it a bit easier to have my requisites pre installed.

0
JayaChatterjee-MSFT On

Yes that's correct. Azure App Service/Azure Function runs in a secure environment called a sandbox which imposes certain limitation. Limitations like playing around some com components , writing to registry , User32/GDI32 restrictions. The sandbox is described here.

I am afraid you won't be able to access the console and install any 3rd party libraries which run via a script, ex: EXE or MSI. So you don't have to explicitly load/install anything.

So if you have anything related to any of these Sandbox restriction then going for Azure VM ( you can manage the OS and the installed libraries yourself ) will make more sense.

Just for your reference, you may refer to this to check which package is installed for your app service. [ Note : as this document is old you may not see the latest VS example but it would guide you to check the version details of the library]