Payara Cloud

Application Configuration

Payara Qube (Managed) supports MicroProfile Config, Spring Boot and Quarkus configuration properties, providing an intuitive dashboard for managing all aspects of your application configuration.

For Jakarta EE/MicroProfile applications, configuration properties are managed through MicroProfile Config using the microprofile-config.properties file.

For Spring Boot applications, configuration properties are managed using Spring Boot’s standard application.properties file.

For Quarkus applications, configuration properties are managed using Quarkus’s standard application.properties file.

Accessing Application Configuration

Click on the Application Actions button to access all actions related to the application.

The unconfigured status means that the platform detected that a configuration is required before you can deploy your application. The Deploy action is also not available when the status is unconfigured. When the application uses a database (found a persistence.xml file, not when using @DataSourceDefinition) the status is automatically unconfigured until the configuration is made.

To configure your application for deployment, click Change Configuration.

Configuration Overview

Payara Qube (Managed) has support for configuration areas including application properties, context root, and database connections for data sources. The configuration screen will display:

  • Configuration Properties for Jakarta EE/MicroProfile applications using microprofile-config.properties, Spring Boot applications using application.properties, and Quarkus applications using application.properties

  • Database Configuration values if your application contains a persistence.xml file (Jakarta EE/MicroProfile), Spring Boot data source configuration, or Quarkus data source configuration

If your application connects to a datasource you’ll first provide the JDBC URL, datasource class, and the username and password used to authenticate your connection to the database server.

You’ll select your runtime size in the drop-down box based on the amount of resources you need to allocate for this instance. The resources count against the included CPU of your subscription.

The Runtime Type provides options for different application scenarios:

  • For Jakarta EE 8 applications, select Payara 5, JDK 11

  • For Jakarta EE 10 applications, select Payara 6, JDK 21

  • For Spring Boot applications, select the appropriate Spring Boot runtime option

  • For Quarkus applications, select the appropriate Quarkus runtime option

image

Configuration Properties

You can add, update and remove configuration properties for your application on the configuration panel of the application dashboard. The specific configuration mechanism used depends on your application type:

  • Jakarta EE/MicroProfile applications: Use MicroProfile Config properties

  • Spring Boot applications: Use Spring Boot configuration properties

  • Quarkus applications: Use Quarkus configuration properties

application 14 mp config
Figure 1. Configuration settings
  • ❶ Restrict Fields: This option allows you to mark fields as restricted for confidentiality. Values of restricted fields will be represented as * characters

  • ❷ Add Config Property: Clicking this button opens up the form to add a new configuration property for your application

Adding Configuration Properties

For Jakarta EE/MicroProfile, Spring Boot, and Quarkus applications, you can create new properties by clicking the Add Configuration Key.

Configuration properties provide a way to externalize configuration parameters for your application:

  • Jakarta EE/MicroProfile applications: Use MicroProfile Config properties from microprofile-config.properties. You can inject them using CDI (@ConfigProperty) or retrieve them programmatically.

  • Spring Boot applications: Use Spring Boot configuration properties from application.properties or application.yml. These can be injected using @Value or @ConfigurationProperties.

  • Quarkus applications: Use application properties from application.properties. You can inject them using @ConfigProperty or access them programmatically.

When you upload your application, Payara Qube (Managed) looks for the appropriate configuration file (microprofile-config.properties for Jakarta EE/MicroProfile, or application.properties for Spring Boot and Quarkus) to read existing configuration parameters. Your default parameters are read and displayed here, and you can override them or add new configuration keys. The Add Configuration Key is useful when reading configuration values programmatically or when the values don’t have a default in your configuration files.

application 19 add config key
Figure 2. Add Configuration Key

Configuration properties added through the Payara Qube (Managed) Console are made available to your application at runtime, but they will NOT modify or be written back to your application’s .properties files. This ensures that your application’s source configuration files remain unchanged while still allowing you to override or add configuration values through the platform interface.

Automatic Sensitive Field Detection

During the application upload process, Payara Qube (Managed) performs a best-effort automatic detection and pre-restriction of configuration properties that may contain sensitive information such as API keys, passwords, tokens, and other credentials.

This automatic detection is a best-effort process and may not identify all possible sensitive fields in your configuration. Users should review their configuration properties and manually restrict any additional sensitive fields as needed using the field restriction features described below.

Spring Boot Property Limitations

For Spring Boot applications, while you can modify certain properties through the Payara Qube (Managed) Console, any changes to the following system-managed properties will be ignored at runtime. Payara Qube (Managed) hardcodes these values to ensure proper operation and log collection for the Spring application instance:

# Server configuration
server.forward-headers-strategy=NATIVE
server.port=8080
server.servlet.context-path=[auto-determined]
spring.application.name=[auto-determined]

# Management and monitoring
management.health.probes.enabled=true
management.endpoint.prometheus.enabled=true
management.endpoints.web.exposure.include=prometheus,metrics,health

Add Config Key

  • ❶ Name of configuration property

  • ❷ Click to add property

Clicking Add Property creates a new text box to enter a value.

application 20 set prop value
Figure 3. Set property value

Click Save to save property value.

image

Common Spring Boot Properties

Spring Boot applications typically use properties such as:

# Application configuration
server.port=8080
spring.application.name=my-spring-app

# Database configuration
spring.datasource.url=jdbc:postgresql://localhost:5432/mydb
spring.datasource.username=myuser
spring.datasource.password=mypassword

# Logging configuration
logging.level.com.example=DEBUG
logging.pattern.console=%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n

These properties can be configured through the Payara Qube (Managed) Console when deploying your Spring Boot application.

Common Quarkus Properties

Quarkus applications typically use properties such as:

# Application configuration
quarkus.application.name=my-quarkus-app
quarkus.http.port=8080

# Database configuration
quarkus.datasource.db-kind=postgresql
quarkus.datasource.username=myuser
quarkus.datasource.password=mypassword
quarkus.datasource.jdbc.url=jdbc:postgresql://localhost:5432/mydb

# Logging configuration
quarkus.log.level=INFO
quarkus.log.category."com.example".level=DEBUG

These properties can be configured through the Payara Qube (Managed) Console when deploying your Quarkus application.

Restricting Fields

You can restrict configuration properties (MicroProfile Config, Spring Boot, and Quarkus properties) by clicking the Restricted Fields link on the configuration panel.

Clicking that button brings up the restrict fields option as shown below.

application 15 restrict fields
Figure 4. Restrict fields option

You can select any number of fields to set as restricted. Clicking save, the restricted fields will be rendered as follows.

application 16 restrected fields
Figure 5. Restricted config fields

Context Root

By default, the name of the WAR file is taken as the context root on which the application is made available. Using the Application Configuration screen, this value can be changed.

Table Description automatically generated with medium confidence

Internet-Accessible Paths

While everything served under a specified context root path is accessible to other applications within the namespace, it is possible to restrict which sub-paths of the context root are accessible over the internet. By default all paths are available /*

To set which sub-paths are accessible, enter space-separated patterns in the form of /prefix*. Sub-paths matching this prefix will be available through the domain name of the namespace, while other paths will only be accessible to other applications within the same namespace.

For example, let’s assume Context Root of /orders and Internet-Accessible Paths /details/ /cancel/.

Then requests like

https://namespace-domain.payara.app/orders/details/000234

or

https://namespace-domain.payara.app/orders/cancel/00234

are directed to application.

Requests to https://namespace-domain.payara.app/orders/place will be handled by the application handling the root namespace.

Other applications within this namespace can reach the handler for /place of this application by accessing http://applicationName/orders/place.

Note that communications within a namespace are http only, as the traffic is limited to the namespace. HTTPS is available for inbound traffic into the namespace.

Database Configuration

When you upload your application, Payara Qube (Managed) detects database configuration requirements:

  • Jakarta EE/MicroProfile applications: Looks for the persistence.xml file. If detected, you can specify database source configuration parameters for the referenced JNDI name.

  • Spring Boot applications: Detects Spring Boot data source configuration properties (e.g., spring.datasource.* properties). You can configure database connection parameters through the application properties interface.

  • Quarkus applications: Detects Quarkus data source configuration properties (e.g., quarkus.datasource.* properties). You can configure database connection parameters through the application properties interface.

Application Description automatically generated

Alternative Database Configuration Methods

Jakarta EE/MicroProfile: Databases without JPA

If you are using plain JDBC connections instead of the JPA functionality of Jakarta EE, you can make use of the @DataSourceDefinition:

@DataSourceDefinition(name="java:global/jdbc/cloud-postgres",
        className="org.postgresql.ds.PGSimpleDataSource",
        serverName = "${MPCONFIG=ds_servername}",
        portNumber = 5432,
        databaseName = "${MPCONFIG=ds_databasename}",
        user="${MPCONFIG=ds_username}",
        password="${MPCONFIG=ds_password}"
)

Or define the <data-source> element in web.xml:

<data-source>
    <name>java:global/jdbc/cloud-mysql</name>
    <class-name>com.mysql.jdbc.jdbc2.optional.MysqlDataSource</class-name>
    <server-name>${MPCONFIG=ds_servername}</server-name>
    <port-number>3306</port-number>
    <database-name>${MPCONFIG=ds_databasename}</database-name>
    <user>${MPCONFIG=ds_username}</user>
    <password>${MPCONFIG=ds_password}</password>
</data-source>

combined with MPCONFIG MicroProfile Config variables. These variables can be configured in the Payara Qube (Managed) Console.

If you are using plain JDBC connections instead of the JPA functionality of Jakarta EE, you need to define the MicroProfile configuration keys manually in Payara Qube (Managed) so the system can detect them as described above. Click 'Add Configuration Key' and enter the property value. In both cases, make sure the appropriate database driver is included in the WAR file you deploy.

Spring Boot: Database Configuration

For Spring Boot applications, database configuration is typically done through standard Spring Boot properties:

# PostgreSQL example
spring.datasource.url=jdbc:postgresql://localhost:5432/mydb
spring.datasource.username=${spring.datasource.username}
spring.datasource.password=${spring.datasource.password}
spring.datasource.driver-class-name=org.postgresql.Driver

# MySQL example
spring.datasource.url=jdbc:mysql://localhost:3306/mydb
spring.datasource.username=${spring.datasource.username}
spring.datasource.password=${spring.datasource.password}
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver

These properties can be configured through the Payara Qube (Managed) application properties interface, allowing you to set database connection parameters without modifying your application code. Make sure the appropriate database driver dependency is included in your Spring Boot application.

image

Allowing Access to your Database from Payara Qube (Managed)

If you’d like to provision a database for the best possible performance, it is recommended to provision it on Microsoft Azure in the same region as the namespace. If your database access is restricted by IP address, enable access to the following IP addresses based on the region the namespace is located in:

Region IP Address(es)

Azure, West Europe

20.101.201.13

Azure, East US

40.76.131.181

If you’d like to provision a database for the best possible performance, it is recommended to provision it on Microsoft Azure in the same region as the namespace.

When you are happy with your configuration settings, click Save to return to the application details screen.

A screenshot of a computer Description automatically generated
Back to Top