I'm trying to deploy a Spring Boot application to Microsoft Azure Spring Apps using Maven.
I strictly followed this tutorial from Microsoft : https://learn.microsoft.com/en-us/azure/spring-apps/how-to-maven-deploy-apps , except for the azure-spring-apps-maven-plugin which had to be upgraded from 1.10.0 to 1.17.0, as per follows :
mvn com.microsoft.azure:azure-spring-apps-maven-plugin:1.17.0:config
But when running the deploy command with the sample project :
mvn azure-spring-apps:deploy
The following "Invalid arguments: DeploymentSettings must be provided" error occurs :
[ERROR] Operator called default onErrorDropped
reactor.core.Exceptions$StaticThrowable: Operator has been terminated
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 13.680 s
[INFO] Finished at: 2023-05-02T19:06:23+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.microsoft.azure:azure-spring-apps-maven-plugin:1.17.0:deploy (default-cli) on project hellospring: create or update Spring app(hellospring) from config: AzureToolkitRuntimeException: create Azure Spring App deployment (default): Status code 400, "{"error":{"code":"BadArgument","message":"Invalid arguments: DeploymentSettings must be provided.","details":[{"code":"BadArgument","message":"DeploymentSettings must be provided.","target":"Properties.DeploymentSettings"}]}}" -> [Help 1]
The HelloSpring sample application does not require any specific configuration (no database, no file storage, no https certificates, etc.).
Any idea of what I may be doing wrong?
I would suggest you to run
mvn clean installbefore deploying your application to Azure Spring Apps.And also Check if the below configuration is being added in your pom.xml file after running
mvn com.microsoft.azure:azure-spring-apps-maven-plugin:1.17.0:config.I have created a spring boot application and deployed to Azure Spring Apps:
mvn com.microsoft.azure:azure-spring-apps-maven-plugin:1.17.0:configcommand. This will ask to select the subscription, Resource group, Azure Spring Apps name, Java runtime version etc., and then generate the configurations required for deployment.I was also getting errors initially and couldn't deploy the application. But, after running the command
mvn clean install, I was able to deploy the application to spring apps.Deploying the application to Azure Spring Apps:
Portal:
Response: