我已在 Azure 云服务上为 Web 角色设置启动任务。 它执行一个startup.cmd 文件,在云上安装第三方软件。 我在本地机器上测试过,效果很好。
现在我对其在 Azure 云服务器上的执行有一些疑问:
- 一旦我在以下位置发布我的应用程序,启动任务就会立即执行 服务器?或者我必须手动执行一些操作才能执行它。
- 如何获取启动任务执行的信息?就像它一样 成功、失败或者执行与否?错误消息等等。
谢谢
最佳答案
您的问题的答案来自此link
:
Will startup task execute as soon as I publish my application on server? Or I have to do something manually to get it executed.
是的。您不必手动触发这些启动任务。请参阅Role Startup Order
链接中的部分了解更多详细信息。
How can I get information about execution of startup task? like it's success, failure or is it executed or not? error messages and all.
您可以将启动任务执行期间遇到的错误记录在 TEMP
环境变量指定的目录中。来自同一链接:
Your startup task can log information and errors to the directory specified by the TEMP environment variable. During the startup task, the TEMP environment variable resolves to the C:\Resources\temp[guid].[rolename]\RoleTemp directory when running on the cloud.
Startup tasks must end with an errorlevel (or exit code) of zero for the startup process to complete. If a startup task ends with a non-zero errorlevel, the role will not start.
关于azure - Azure 云启动任务何时执行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47937017/