Skip to content

Azure Spring Apps: Config

Jialuo Gan edited this page May 6, 2022 · 2 revisions

azure-spring-apps:config

  • This goal will set up the plugin configuration used in azure-spring-apps:deploy through a step by step wizard. It will require you to login using any way described in Authentication Methods section. You will proceed with the following steps, after you have finished these steps, the configuration for azure-spring-apps-maven-plugin will be filled with values you selected during the wizard, then you can execute azure-spring-apps:deploy. With default mode, you will be promoted with the following steps:

  • select or confirm default subscription: subscriptionId (if there is only one subscription available in your account, the subscriptionId will be set automatically)

  • select or confirm Azure Spring Cloud: clusterName(if there is only one cluster available in your subscription, the clusterName will be set automatically)

  • provide appName or accept default as artifactId

  • provide whether or not to expose the public access to this app

With advanced mode by executing mvn azure-spring-apps:config -DadvancedOptions, you will be promoted with some additional steps:

  • provide the following parameters (press ENTER to use default value):
    • instanceCount
    • cpu
    • memoryInGB
    • jvmOptions

All the settings will be validated before writing to the pom.xml, you should get no configuration error when you executing deploy goal.

Note:
- the pom.xml will be modified by this goal if you select yes in last step(by default is yes).
- if you have no cluster created, this goal will fail with error messages.
- if you don't have azure-spring-apps-maven-plugin in <build><plugins> section, a new azure-spring-maven-apps-plugin section will be added to the existing pom.xml with configuration collected.
- if you have already existing properties configured in azure-spring-apps-maven-plugin, the config goal will exit without errors(this means you cannot config twice for the same project unless you delete the configuration manually), the <auth> section in <configuration> is not considered as spring configuration.
The properties not asked in the steps will be filled with default values.
It is OK to have no <auth> section, in this case, this goal will seek credentials from azure-secret.json, azure cli token and cloud shell token(MSI Credential). If none of above ways fails, this goal will trigger an azure:login goal to get the credential. If this project has an <auth> section, this goal will only get credentials from configuration from <auth> section, if there are any errors during getting credentials, this goal will fail.

Multi-jar behavior

  • If executed in parent folder, you will be promoted with the following steps:
    • select one or more projects which are supposed to be deployed as an app.
    • select or confirm the default subscription: subscriptionId
    • select or confirm the Azure Spring Cloud(ASC): clusterName(if there is only one ASC available in your subscription, the clusterName will be set automatically)
    • select some apps which are supposed to be public accessible.

Note:
The advanced mode will not be support at parent folder.
All the changes will be save to each child pom.xml files once you select yes in last step(by default is yes). The parent pom.xml will be updated in azure-spring-apps plugin with no configuration.
If you run this goal on a partially configured folder(some of the projects have <configuration> section and some of the projects don't), the projects with <configuration> section will not be selectable and thus cannot be reconfigured.
The properties not asked in the steps will be filled with default values.
This goal will do nothing if all the projects are already configured.
If you have not selected any projects, this goal will exit successfully.