Windows Azure 上でhttpをhttpsへリダイレクト

IISでリダイレクトを使う場合にはURL Rewrite Moduleが必要なのだが、Windows Azure上のIISには既にインストールされているらしいのでリダイレクトの設定だけWeb.configの配下に以下のように設定

	  <!-- HTTPSリダイレクト -->
	  <rewrite>
		  <rules>
			  <rule name="Force HTTPS" enabled="true">
				  <match url="(.*)" ignoreCase="false" />
				  <conditions>
					  <add input="{HTTPS}" pattern="off" />
				  </conditions>
				  <action type="Redirect" url="https://{HTTP_HOST}/{R:1}" appendQueryString="true" redirectType="Permanent" />
			  </rule>
		  </rules>
	  </rewrite>

確認してみた所うまくいっている模様

参考
http://blog.smarx.com/posts/redirecting-to-https-in-windows-azure-two-methods