How to deploy an executable file in app services?

Joseph 1 Reputation point
2021-02-28T13:56:58.103+00:00

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 App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,052 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 29,291 Reputation points Microsoft Employee
    2021-03-03T04:23:30.813+00:00

    Hi @Joseph , 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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.