2017-05-05 31 views
2

nodejsサーバーからAzure Webappでexeファイルを実行しようとしています。 exeは、単純なpythonファイルPyInstallerによって作成されます。Azure WebappでEXEファイルを実行できません

var exec = require('child_process').exec; 
let cmd = 'hello.exe'; 
let child = exec(
    cmd, { 
     cwd: path_to_exe_file 
    }, 
    function(error, stdout, stderr) { 
     if (error === null) { 
      res.render('index', { title: stdout }); 
     } else { 
      console.log(error);     
      res.json({ 
       'status': '400', 
       'res': error 
      }); 
     } 
    } 
); 

すべては私のマシン上でうまく動作しますが、私はアズールのWebアプリケーションに展開するときにはエラーが判明:アプリケーションがサイドバイサイド構成が正しくないため の起動に失敗しました

Error: Command failed: hello.exe The application has failed to start 
because its side-by-side configuration is incorrect. 
Please see the application event log or use the command-line sxstrace.exe 
tool for more detail. 
at ChildProcess.exithandler (child_process.js:206:12) 
at emitTwo (events.js:106:13) 
at ChildProcess.emit (events.js:191:7) 
at maybeClose (internal/child_process.js:877:16) 
at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5) killed: false, code: 1, signal: null, cmd: 'hello.exe' } 

この問題を解決するにはどうすればよいですか?ありがとう

+0

Azure Web AppsにはPythonランタイムが含まれていますが、Azure Web Appsのnode.jsスクリプトでPythonスクリプトを実行することもできます。そして、この問題は 'pyinstaller'が使用しているC++の依存関係のために起こります。 Azure Web AppでC++コンポーネントを処理する権限がほとんどないためです。それで、可能であれば、Pythonスクリプトを直接execできますか? –

+0

はい、pyinstallerによる問題です。 NET exeファイルについて、Azure Web Appsのnodejsスクリプトで.Net exeファイルを実行できますか? –

答えて

1

Yes, the problem due to pyinstaller. How about .Net exe file, can I run .Net exe file in nodejs script on Azure Web Apps?

はい、基本的に可能です。また、私のテストプロジェクトでは、最も単純な.NETコンソールexeで動作します。

しかし、注意が必要な点がいくつかあります.SanboxとしてのAzure Web App envでは、いくつかの厳しい制限があり、Azure Web Apps上で.NET exeアプリケーションのすべてを実行できないという制限がいくつかあります。詳細はhttps://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandboxを参照してください。

さらに、シナリオによっては、WebJobsを使用してexeアプリケーションまたはタスクを実行することもできます。

関連する問題