skip to Main Content

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 ?

Thanks a lot for your help

2

Answers


  1. Azure Spring Apps deployment with Maven causes error : Invalid arguments: DeploymentSettings must be provided

    I would suggest you to run mvn clean install before 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.

    <plugin>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-spring-apps-maven-plugin</artifactId>
            <version>1.17.0</version>
            <configuration>
                        
                <subscriptionId>Azure_SUbscription_id</subscriptionId>
                <resourceGroup>Resource_group_name</resourceGroup>
                <clusterName>kpspringapp</clusterName>
                <appName>springboot-crud</appName>
                <isPublic>false</isPublic>
                <deployment>
                      <cpu>1</cpu>
                      <memoryInGB>1</memoryInGB>
                      <instanceCount>1</instanceCount>
                      <runtimeVersion>Java 11</runtimeVersion>
                      <resources>
                          <resource>
                              <filtering/>
                              <mergeId/>
                              <targetPath/>
                            <directory>${project.basedir}/target</directory>
                              <includes>
                                   <include>*.jar</include>
                              </includes>
                           </resource>
                       </resources>
                  </deployment>
             </configuration>
        </plugin>
    

    I have created a spring boot application and deployed to Azure Spring Apps:

    1. Logged into Azure via command line.

    enter image description here

    1. Generating the configurations to deploy the Spring Boot application to Azure Spring Apps by running mvn com.microsoft.azure:azure-spring-apps-maven-plugin:1.17.0:config command.
      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.

    enter image description here
    enter image description here

    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.

    enter image description here
    enter image description here
    enter image description here

    Deploying the application to Azure Spring Apps:

    enter image description here

    Portal:
    enter image description here

    Response:
    enter image description here

    Login or Signup to reply.
  2. Same issue here. Tried all of the above and still get the same error (using plugin 1.17)
    One thing I did notice is that everything works perfectly if you are not using the "Standard Consumption" plan. If you use at least "Basic" everything works as it should. I have retested this a few times and each time it works fine with "Basic" but not "Consumption"

    Obviously this is not ideal, perhaps there is update coming soon?

    Last thing I tried was to reinstall the Azure CLI extension "for the Azure Spring Apps Standard consumption plan" as described in this tutorial but still get same results.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search