前提
Azure WebApp のサーバータイプはWindows
操作
- Azure Webコンソール上で App Service を開く
- Development Toolsのうち「Advanced Tools」を開く(Kudu)
- Debug Consoleから「CMD」を開く(単なるコマンドラインではなくGUI的にも使える)
- デフォルトで「D:\home」が開いている状態なので「D:\home\site\wwwroot」を開く(マウス操作でも可能)
- [wwwroot]の右側にある「+」をクリックして「New File」を選択する
- 「web.config」というファイルを作成して以下のようにする。「%AZURE_TOMCAT90%」はTOMCATのバージョンによって異なるので確認する。(SETコマンドで環境変数一覧が表示されるのでそこで確認できる)
- アプリを再起動する
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="%AZURE_TOMCAT90_HOME%\bin\startup.bat" arguments="">
<environmentVariables>
<environmentVariable name="JAVA_OPTS" value="-Xmx1500m -Xms1024m -Djava.net.preferIPv4Stack=true" />
</environmentVariables>
</httpPlatform>
</system.webServer>
</configuration>
以上。