1

我试图根据下面的 MSDN 文章包含一个任务:http: //msdn.microsoft.com/en-us/library/windowsazure/jj154098.aspx

但是,我在其中一个实例上收到以下错误;

回收(等待角色启动...应用程序启动任务失败,退出代码为 1。[2013-04-13T11:03:22Z])

有人可以建议真正发生的事情以及解决方法(如果有的话)吗?

下面是我的cmd:

@echo off

@echo Installing "IPv4 Address and Domain Restrictions" feature 
%windir%\System32\ServerManagerCmd.exe -install Web-IP-Security

@echo Unlocking configuration for "IPv4 Address and Domain Restrictions" feature 
%windir%\system32\inetsrv\AppCmd.exe unlock config -section:system.webServer/security

和中国自卫队:

<Startup>
  <Task commandLine="Startup.cmd" executionContext="elevated"/>      
  <Task commandLine="startup\startup.cmd" executionContext="elevated"/>
</Startup>

谢谢

4

2 回答 2

5

我曾经遇到过类似的问题。我通过在我的启动脚本中添加以下内容来修复它:

exit /b 0

如果没有这个,Azure Fabric 不会将脚本注册为已完成,它会继续回收实例。

我看到你使用ServerManagerCmd.exe。此命令已从 Windows Server 2012 中删除。因此,请确保您的角色未使用最新的 OS 系列版本进行部署。

<ServiceConfiguration ... osFamily="1" ...>
于 2013-04-13T12:18:32.627 回答
3

What you can do here is RDP into the instance and run the .CMD file manually to see if it's throwing any errors.

I received a similar error when deploying to Azure and it was caused by the startup command raising a dialogue box that required a user input. Essentially the alert box was confirming that a .dll had been registered, that's all, but it was enough to stop the deployment routine in it's tracks.

Here is the contents of my .cmd file:

chcp 1252>NUL
regsvr32 /s .\library\asppdf64.dll
regsvr32 /s .\library\aspjpeg64.dll
exit /b 0

The /s tells the service to run silently (i.e. with dialogues purged). The chcp 1252>NUL sets the code-page.

于 2013-04-13T11:48:54.750 回答