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' }
この問題を解決するにはどうすればよいですか?ありがとう
Azure Web AppsにはPythonランタイムが含まれていますが、Azure Web Appsのnode.jsスクリプトでPythonスクリプトを実行することもできます。そして、この問題は 'pyinstaller'が使用しているC++の依存関係のために起こります。 Azure Web AppでC++コンポーネントを処理する権限がほとんどないためです。それで、可能であれば、Pythonスクリプトを直接execできますか? –
はい、pyinstallerによる問題です。 NET exeファイルについて、Azure Web Appsのnodejsスクリプトで.Net exeファイルを実行できますか? –