I am trying to deploy my SpringAPI to Azure Web App using Azure Maven Plugin but I am getting this Error
Failed to execute goal com.microsoft.azure:azure-webapp-maven-plugin:2.12.0:deploy (default-cli) on project demo: deploy to Azure Web App with resource creation or updating: AzureToolkitRuntimeException: deploy to Azure Web App(GSHFLCSpringApiDev) with resource creation or updating: Status code 400, (empty body) -> [Help 1]
[WARNING] 'Content-Type' not found. Returning default encoding: JSON
[ERROR] Status code 400, (empty body)
2023-09-15T01:32:34.370569183Z: [INFO] __COM_MICROSOFT_AZURE_APPSERVICE_JARENTRYPOINT_PREFIX____COM_MICROSOFT_AZURE_APPSERVICE_JARENTRYPOINT_SUFFIX__
2023-09-15T01:32:34.437610191Z: [INFO] Extracted jar entry point. Class name is: ''
2023-09-15T01:32:34.450039049Z: [INFO] Defaulting to UTF-8
2023-09-15T01:32:34.450393579Z: [INFO] Failed to query jar entry point. Falling back to legacy command-line
2023-09-15T01:32:34.451472271Z: [INFO] Running command: java -Djava.util.logging.config.file=/usr/local/appservice/logging.properties -Dfile.encoding=UTF-8 -Dserver.port=80 -XX:ErrorFile=/home/LogFiles/java_error_GSHFLCSpringApiDev_10-30-0-53_%p.log -XX:+CrashOnOutOfMemoryError -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/home/LogFiles/java_memdump_GSHFLCSpringApiDev_10-30-0-53.log -Duser.dir=/home/site/wwwroot -jar /home/site/wwwroot/app.jar:/usr/local/appservice/lib/azure.appservice.jar
2023-09-15T01:32:34.452219635Z: [INFO] Launched child process with pid: 97
2023-09-15T01:32:34.458934106Z: [ERROR] Error: Unable to access jarfile /home/site/wwwroot/app.jar:/usr/local/appservice/lib/azure.appservice.jar
2023-09-15T01:32:34.482425006Z: [INFO] Waiting for main process to exit. GLOBAL_PID_MAIN=97
2023-09-15T01:32:34.482808739Z: [INFO] Done waiting for main process. GLOBAL_PID_MAIN=97.
2023-09-15T01:32:34.482832341Z: [INFO] Exiting entry script!
From what I understand , it is because the server is being sent a bad request during deployment, hence the server return empty body
Here is my Configuration for the Azure Maven Plugin
<plugin>
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-webapp-maven-plugin</artifactId>
<version>2.12.0</version>
<configuration>
<schemaVersion>v2</schemaVersion>
<subscriptionId>767121d7-cf5e-4725-a8bf-39eeed5da6ac</subscriptionId>
<resourceGroup>GSHFLCSpringApiDevResourceGroup</resourceGroup>
<appName>GSHFLCSpringApiDev</appName>
<pricingTier>F1</pricingTier>
<region>Southeast Asia</region>
<runtime>
<os>Linux</os>
<javaVersion>Java 17</javaVersion>
<webContainer>Java SE</webContainer>
</runtime>
<deployment>
<resources>
<resource>
<directory>${project.basedir}/target</directory>
<includes>
<include>*.jar</include>
</includes>
</resource>
</resources>
</deployment>
</configuration>
</plugin>