Azure 云启动任务何时执行?

When is a Azure Cloud Startup Task Executed?

我已经在我的 Azure 云服务上为 Web 角色设置了启动任务。 它执行一个 startup.cmd 文件,在云上安装第三方 S/W。 我已经在我的本地机器上测试过了,它运行良好。

现在我对它在 Azure 云服务器上的执行有一些疑问:

  1. 启动任务会在我发布我的应用程序后立即执行吗 服务器?或者我必须手动执行某些操作才能执行它。
  2. 如何获取有关启动任务执行的信息?就像它 成功、失败或是否执行?错误消息和所有。

谢谢

您问题的答案来自 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.

是的。您不必手动触发这些启动任务。有关详细信息,请参阅 link 中的 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 环境变量指定的目录中记录在执行启动任务期间遇到的错误。来自同一个 link:

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.