如何在具有多个控制台应用程序项目的 Web 作业中定义默认 exe?
How to define the default exe in a webjob that has multiple console app projects?
我有一个控制台应用程序解决方案,其中包含多个部署为 Azure Webobs 的项目。部署进行得很好,但 webjob 对解决方案中的启动项目一无所知。执行 webjob 时,它会从列表中选择第一个 .exe 文件并 运行s 它。这是不正确的,需要知道如何将启动项目强制执行到 webjobs。想提一下,我可以 运行 从 azure webjob 控制台手动启动 exe,但计划进程在 运行ning 时不知道启动 exe。
我们可以从 official document 中得到答案。以下是文档中的片段。如果我们首先要运行.exe,我们可以将其命名为run.exe.
we use the following logic to decide which file is the script to run within the job's directory:
Per file type we look first for a file named: run.{file type extension} (for example run.cmd or run.exe).
If it doesn't exists for all file types, we'll then look for the first file with a supported file type extension.
The order of file types extension used is: .cmd, .bat, .exe, .ps1, .sh, .php, .py, .js.
The following file types are accepted as runnable scripts that can be used as a job:
- fsx (using the F# fsi.exe interactive compiler)
- cmd, .bat, .exe (using windows cmd)
- ps1 (using powershell)
- sh (using bash)
- php (using php)
- py (using python)
- js (using node)
我有一个控制台应用程序解决方案,其中包含多个部署为 Azure Webobs 的项目。部署进行得很好,但 webjob 对解决方案中的启动项目一无所知。执行 webjob 时,它会从列表中选择第一个 .exe 文件并 运行s 它。这是不正确的,需要知道如何将启动项目强制执行到 webjobs。想提一下,我可以 运行 从 azure webjob 控制台手动启动 exe,但计划进程在 运行ning 时不知道启动 exe。
我们可以从 official document 中得到答案。以下是文档中的片段。如果我们首先要运行.exe,我们可以将其命名为run.exe.
we use the following logic to decide which file is the script to run within the job's directory: Per file type we look first for a file named: run.{file type extension} (for example run.cmd or run.exe). If it doesn't exists for all file types, we'll then look for the first file with a supported file type extension. The order of file types extension used is: .cmd, .bat, .exe, .ps1, .sh, .php, .py, .js.
The following file types are accepted as runnable scripts that can be used as a job:
- fsx (using the F# fsi.exe interactive compiler)
- cmd, .bat, .exe (using windows cmd)
- ps1 (using powershell)
- sh (using bash)
- php (using php)
- py (using python)
- js (using node)