-
Notifications
You must be signed in to change notification settings - Fork 150
Set JAVA_OPTS for Windows App Services
Hanxiao Liu edited this page Nov 13, 2019
·
2 revisions
We removed web.config
since azure-webapp-maven-plugin:1.8.0
, and here is the new workaround to set JAVA_OPTS for Windows App Services
- Create new
startup.cmd
file in project folder as below
"%JAVA_HOME%\bin\java.exe" -noverify -Djava.net.preferIPv4Stack=true -Dserver.port=%HTTP_PLATFORM_PORT% %JAVA_OPTS% -jar "%_WEBAPP_DIR%\app.jar"
- Add
startup.cmd
to<resources>
configuration
<configuration>
<schemaVersion>V2</schemaVersion>
...
<deployment>
<resources>
<resource>
<directory>${project.basedir}/target</directory>
<includes>
<include>*.jar</include>
</includes>
</resource>
<resource>
<directory>${project.basedir}</directory>
<includes>
<include>startup.cmd</include>
</includes>
</resource>
</resources>
</deployment>
</configuration>
- Add Java opts to
<appSettings>
<configuration>
<schemaVersion>V2</schemaVersion>
...
<appSettings>
<!--JVM OPTIONS -->
<property>
<name>JAVA_OPTS</name>
<value>-Xms2048m -Xmx2048m</value>
</property>
</appSettings>
...
</configuration>
- Deploy with
azure-webapp:deploy
, and new java opts should works.
- Home
- Authentication
- Proxy
- Common Configurations
-
Maven Plugin for Azure Web Apps
- Quickstarts
- Goals
- Configuration Details
- Samples
-
Maven Plugin for Azure Functions
- Quickstarts
- Archetype
- Goals
- Configuration Details
-
Maven Plugin for Azure Spring Apps
- Quickstarts
- Goals
- Configuration Details
- Using in CI/CD