An .Exe running in Azure app service causes problems

Zakaria KHORF 1 Reputation point
2021-09-01T15:52:50.347+00:00

When a Node.js module runs a .exe on my linux azure app service file this bug appears :

Error: spawn /node_modules/mso-pdf/mso-pdf.exe EACCES
2021-09-01T15:45:31.299726157Z at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
2021-09-01T15:45:31.299731257Z at onErrorNT (internal/child_process.js:465:16)
2021-09-01T15:45:31.299736257Z at processTicksAndRejections (internal/process/task_queues.js:80:21)
2021-09-01T15:45:31.299741057Z Emitted 'error' event on ChildProcess instance at:
2021-09-01T15:45:31.299746058Z at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
2021-09-01T15:45:31.299763558Z at onErrorNT (internal/child_process.js:465:16)
2021-09-01T15:45:31.299768459Z at processTicksAndRejections (internal/process/task_queues.js:80:21) {
2021-09-01T15:45:31.299773059Z errno: -13,
2021-09-01T15:45:31.299777759Z code: 'EACCES',
2021-09-01T15:45:31.299782259Z syscall: 'spawn /node_modules/mso-pdf/mso-pdf.exe',
2021-09-01T15:45:31.299786859Z path: '/node_modules/mso-pdf/mso-pdf.exe',
2021-09-01T15:45:31.299814961Z spawnargs: [
2021-09-01T15:45:31.299820261Z 'WD',
2021-09-01T15:45:31.299824561Z '/home/site/wwwroot/dist/output.docx',
2021-09-01T15:45:31.299828861Z '/home/site/wwwroot/dist/output.pdf'
2021-09-01T15:45:31.299845662Z ]
2021-09-01T15:45:31.299849962Z }

I think it is a permissions problem, any ideas ?

Thanks

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,171 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ajkuma 23,641 Reputation points Microsoft Employee
    2021-09-02T12:38:21.12+00:00

    @Zakaria KHORF , Thanks for posting a good question.

    All Azure Web Apps run in a secure environment called a sandbox. Each app runs inside its own sandbox, isolating its execution from other instances on the same machine.
    At first glimpse, the error appears be caused due to sandbox restrictions.

    -Azure WebApps Sandbox -See 'general sandbox restrictions' and 'PDF generation from HTML' sections.
    Operating system functionality on Azure App Service -Linux apps in App Service run in their own containers

    If your requirement fits, you can leverage custom container
    Configure a custom container for Azure App Service
    Customize build automation

    Azure App Service understands package.json and npm-shrinkwrap.json files and can install modules based on entries in these files.
    Using Node.js Modules with Azure applications

    Kindly let us know, I'll follow-up with you further.