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」を追加して、成功コード 0 で終了するようにすることができます。

ほとんどの場合、コマンドは失敗するか、成功しますが、何も変更されていないことを示すためにリターン コードがゼロ以外です。

于 2013-06-02T11:57:27.407 に答える