Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Deploy using azure maven webapp plugin causes multiple deployments and 409 #2522

Open
Mds1025 opened this issue Jan 8, 2025 · 1 comment

Comments

@Mds1025
Copy link

Mds1025 commented Jan 8, 2025

Hello, we updated a Java 8 application to Java 17, and we used azure-webapp-maven-plugin. With java 17 version, we updated also the azure plugin and after that we cannot deploy because we have a 409 error.
Our project structure:
We have a maven multimodule project, so at the end we have an app.jar with some classes and a lot of jar libs (like 200 jars) that are in the same folder of app.jar
With older version, the deploy was pretty fast, all files were uploaded on wwwroot folder in 2-3 minutes.

Problem
After update to azure webapp maven plugin to 2.13.0, it starts to deploy every single jar like a separate deployment. We see on deployment center a lot of lines of deploys (in the previous version it was only one line for all deployment), and after some file uploaded, we receive this error:

[�[1;31mERROR�[m] Failed to execute goal �[32mcom.microsoft.azure:azure-webapp-maven-plugin:2.13.0:deploy�[m �[1m(default-cli)�[m on project �[36mmilleweb-fhir-srv�[m: �[1;31mdeploy to Azure Web App with resource creation or updating�[m: AzureToolkitRuntimeException: deploy to Azure Web App(millefhir-dev) with resource creation or updating: Status code 409, "The 'Preparing zip package' operation conflicts with the pending 'Performing continuous deployment' operation started at 2025-01-08T11:01:35.7240777Z. Please retry operation later.": Unsupported text Content-Type Type: class java.lang.Object -> �[1m[Help 1]�[m

Actual pom:
<plugin> <groupId>com.microsoft.azure</groupId> <artifactId>azure-webapp-maven-plugin</artifactId> <version>2.13.0</version> <configuration> <subscriptionId>${azure.subscriptionid}</subscriptionId> <schemaVersion>${azure.schemaVersion}</schemaVersion> <resourceGroup>${azure.resourceGroup}</resourceGroup> <appName>${azure.appName}</appName> <region>${azure.region}</region> <auth> <client>****HIDDEN*****</client> <tenant>****HIDDEN*****</tenant> <key>****HIDDEN*****</key> <environment>AZURE</environment> </auth> <runtime> <os>${azure.os}</os> <javaVersion>${azure.javaVersion}</javaVersion> <webContainer>${azure.webContainer}</webContainer> </runtime> <appSettings> <property> <name>WEBSITE_TIME_ZONE</name> <value>W. Europe Standard Time</value> </property> <property> <name>configDir</name> <value>D:/home/site/wwwroot/</value> </property> </appSettings> <!-- End of App Settings --> <deployment> <resources> <resource> <type>jar</type> <directory>${project.basedir}/target</directory> <includes> <include>app.jar</include> </includes> </resource> <resource> <type>lib</type> <directory>${project.basedir}/target</directory> <includes> <include>*.jar</include> </includes> </resource> <resource> <directory>${project.basedir}/azure</directory> <includes> <include>web.config</include> <include>ds_jwt_public.pkcs8</include> </includes> </resource> <resource> <directory>${project.basedir}/${logback.environment}</directory> <includes> <include>logback.xml</include> </includes> </resource> </resources> </deployment> </configuration> </plugin>

I tried to use Type attribute but is not working.
For each jar we have something like that line:
[�[1;34mINFO�[m] Deploying (�[36mC:\progetti\milleweb-fhir\milleweb-fhir-srv\target\axis-1.4.jar�[m)[�[36mlib�[m] �[36m to axis-1.4.jar�[m ...

Thank you

@Flanker32
Copy link
Member

@Mds1025 Thanks for your report and sorry for the late response. In new maven plugin we migrate to the new one deploy api of webapp. Did you try the ZIP deployment type in the new version? which you may package your jars into zip file and we will help you deploy it to azure and unzip it. Please refer https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/azure-resourcemanager-appservice/src/main/java/com/azure/resourcemanager/appservice/models/DeployType.java#L59

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants