admin管理员组

文章数量:1297116

Is it possible to execute binaries in a consumption-based function app? The app files are read only in consumption-based apps, so once it is deployed I get an access denied when trying to execute from /home/site/wwwroot/

When I deploy my files to Azure, I have an executable in /home/site/wwwroot/bin, but access is denied when trying to execute from this location. I found out the app files are read-only in consumption-based plans and was wondering if this is possible. I don’t want to have to copy the executable into /tmp/ every time the function executes.

Is it possible to execute binaries in a consumption-based function app? The app files are read only in consumption-based apps, so once it is deployed I get an access denied when trying to execute from /home/site/wwwroot/

When I deploy my files to Azure, I have an executable in /home/site/wwwroot/bin, but access is denied when trying to execute from this location. I found out the app files are read-only in consumption-based plans and was wondering if this is possible. I don’t want to have to copy the executable into /tmp/ every time the function executes.

Share Improve this question asked Feb 11 at 16:13 byrd-csbyrd-cs 1 2
  • Is the machine IIS? IIS is secure and does not allow running executables unless account is ADMIN, It is not recommended to allow executables to run due to hackers getting access to the file. – jdweng Commented Feb 11 at 22:39
  • @jdweng It looks possible in an ASP.NET app running in an App Service that's for sure; but I don't know if the Azure Functions runtime is different from an ASP.NET. Reference: learn.microsoft/en-us/azure/app-service/… – Andrew B Commented Feb 11 at 23:07
Add a comment  | 

1 Answer 1

Reset to default 0

Is it possible? Yes. However, putting aside the fact that copying a binary poses a security risk, you should not be storing anything inside the /tmp/ folder. As the name suggests, it is a temporary folder and is not persistent storage. It gets cleared on a reboot

So, the potential workarounds are:

  1. Containerize the function app. You can create a custom container and deploy your function inside that, giving you full control over the runtime environment

  2. Continue to copy the binary to /tmp/

  3. Use a premium or dedicated plan instead of consumption plan. The filesystem for these plans are writable and persistent.

本文标签: linuxConsumptionbased Azure Functionexecuting binaryStack Overflow