question

Joseph-1439 avatar image
0 Votes"
Joseph-1439 asked ryanchill commented

How to deploy an executable file in app services?

I am trying to create a webapp with PHP. When triggered by a user, a PHP file should call an executable file via command line. My test code so far is as follows:

$command = "CuraEngine.exe slice -v -j fdmprinter.def.json -l 3DBenchy.stl -o 3DBenchy.gcode 2>&1";


where all files are in the same folder and the CuraEngine.exe is in a "bin" subfolder. The result I'm getting is:

[0] => sh: 1: CuraEngine.exe: not found**

How can I run CuraEngine.exe in app services? I have read posts about WebJobs and Functions but I don't know where they apply or where to begin.


azure-webapps
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hello @ryanchill, I was wondering if you can help me with a problem i am having with my project, so I have a Node.js project that runs on a linux App service, however a Module that i am using calls an .exe application and at that moment this error happens :

  Error: spawn /node_modules/mso-pdf/mso-pdf.exe EACCES
  at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
 at onErrorNT (internal/child_process.js:465:16)
 at processTicksAndRejections (internal/process/task_queues.js:80:21)
  Emitted 'error' event on ChildProcess instance at:
     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
   at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
   errno: -13,
  code: 'EACCES',
    syscall: 'spawn /node_modules/mso-pdf/mso-pdf.exe',
    path: '/node_modules/mso-pdf/mso-pdf.exe',
  spawnargs: [
    'WD',
     '/home/site/wwwroot/dist/output.docx',
    '/home/site/wwwroot/dist/output.pdf'
   ]
 }

Apparently its a permission problem, any ideas ?

Thanks

0 Votes 0 ·

Hi @ZakariaKHORF-5552, I see that you post your comment as a question. I appreciate you doing that. @ajkuma-MSFT did you respond to your question, and I encourage you to review you his post and see if helps.

0 Votes 0 ·

1 Answer

ryanchill avatar image
0 Votes"
ryanchill answered

Hi @Joseph-1439, https://github.com/projectkudu/kudu/wiki/WebJobs may help to understand how WebJobs work and can be configured. Since you're looking to execute an actual exe, you may need to...

a) Create a console app that will act as a wrapper that will call CuraEngine.exe
b) Create a bat/cmd/sh script file that will execute $command

If CuraEngine.exe doesn't require any dependencies that need to be installed, you should be okay. Just note that App Services does have certain limitations since it is a sandboxed environment.

It is simple to apply. After creating your app service, you can click on the WebJobs blade, configure the trigger type, and upload your files as zip file. If you run into any issues or have further questions, please feel free to comment down below.

Regards,
Ryan


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.