3

我有一个工作部署。我已添加到云服务角色的配置文件中:

<Startup>
      Task commandLine="EnableCompression.cmd" executionContext="elevated" taskType="simple"></Task>
    </Startup>

然后在cmd文件中:

%windir%\system32\inetsrv\appcmd set config /section:urlCompression /doDynamicCompression:True /commit:apphost
%windir%\system32\inetsrv\appcmd set config  -section:system.webServer/httpCompression /+"dynamicTypes.[mimeType='application/json; charset=utf-8',enabled='True']" /commit:apphost

将此发布到 Azure 时,我得到:

Your role instances have recycled a number of times during an update or upgrade operation. This indicates that the new version of your service or the configuration settings you provided when configuring the service prevent the role instances from running. Verify your code does not throw unhandled exceptions and that your configuration settings are correct and then start another update or upgrade operation.

Cmd 文件具有 COPY ALWAYS 属性。所以这应该没问题。从配置中删除<Startup>标签时,它是成功的。

以上似乎未能部署

这可能是什么原因?谢谢!

4

1 回答 1

4

确保启动命令的返回码始终为零,否则 azure 会假定它失败并回收您的角色。

您可以将“exit 0”作为最后一个命令添加到批处理文件中,以确保它以成功代码零退出。

最有可能的是,命令失败,或者,它确实成功了,但返回码是非零表示没有任何改变等

于 2013-06-02T11:57:27.407 回答