Skip to content

Commit 850cc46

Browse files
committed
add sqldb database
1 parent 96c09a5 commit 850cc46

File tree

7 files changed

+132
-35
lines changed

7 files changed

+132
-35
lines changed

articles/app-service/configure-language-java-apm.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,19 @@ To enable via the Azure CLI, you need to create an Application Insights resource
120120
121121
---
122122
123+
::: zone pivot="java-javase,java-jboss"
124+
125+
> [!NOTE]
126+
> If you already have an environment variable for `JAVA_OPTS`, append the `-javaagent:/...` option to the end of the current value.
127+
128+
::: zone-end
129+
130+
::: zone pivot="java-tomcat"
131+
123132
> [!NOTE]
124-
> If you already have an environment variable for `JAVA_OPTS` or `CATALINA_OPTS`, append the `-javaagent:/...` option to the end of the current value.
133+
> If you already have an environment variable for `CATALINA_OPTS`, append the `-javaagent:/...` option to the end of the current value.
134+
135+
::: zone-end
125136
126137
## Configure AppDynamics
127138
@@ -176,20 +187,20 @@ To enable via the Azure CLI, you need to create an Application Insights resource
176187
## Configure Datadog
177188
178189
# [Linux](#tab/linux)
179-
* The configuration options are different depending on which Datadog site your organization is using. See the official [Datadog Integration for Azure Documentation](https://docs.datadoghq.com/integrations/azure/)
190+
The configuration options are different depending on which Datadog site your organization is using. See the official [Datadog Integration for Azure Documentation](https://docs.datadoghq.com/integrations/azure/)
180191
181192
# [Windows](#tab/windows)
182-
* The configuration options are different depending on which Datadog site your organization is using. See the official [Datadog Integration for Azure Documentation](https://docs.datadoghq.com/integrations/azure/)
193+
The configuration options are different depending on which Datadog site your organization is using. See the official [Datadog Integration for Azure Documentation](https://docs.datadoghq.com/integrations/azure/)
183194
184195
---
185196
186197
## Configure Dynatrace
187198
188199
# [Linux](#tab/linux)
189-
* Dynatrace provides an [Azure Native Dynatrace Service](https://www.dynatrace.com/monitoring/technologies/azure-monitoring/). To monitor Azure App Services using Dynatrace, see the official [Dynatrace for Azure documentation](https://docs.datadoghq.com/integrations/azure/)
200+
Dynatrace provides an [Azure Native Dynatrace Service](https://www.dynatrace.com/monitoring/technologies/azure-monitoring/). To monitor Azure App Services using Dynatrace, see the official [Dynatrace for Azure documentation](https://docs.datadoghq.com/integrations/azure/)
190201
191202
# [Windows](#tab/windows)
192-
* Dynatrace provides an [Azure Native Dynatrace Service](https://www.dynatrace.com/monitoring/technologies/azure-monitoring/). To monitor Azure App Services using Dynatrace, see the official [Dynatrace for Azure documentation](https://docs.datadoghq.com/integrations/azure/)
203+
Dynatrace provides an [Azure Native Dynatrace Service](https://www.dynatrace.com/monitoring/technologies/azure-monitoring/). To monitor Azure App Services using Dynatrace, see the official [Dynatrace for Azure documentation](https://docs.datadoghq.com/integrations/azure/)
193204
194205
---
195206

articles/app-service/configure-language-java-data-sources.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ There are three core steps when [registering a data source with JBoss EAP](https
386386
1. Add the JDBC driver as a module.
387387
1. Add a data source with the module.
388388

389-
App Service is a stateless hosting service, so you must put these steps into a startup script and run it each time the JBoss container starts. Using PostgreSQL and MySQL as an examples:
389+
App Service is a stateless hosting service, so you must put these steps into a startup script and run it each time the JBoss container starts. Using PostgreSQL, MySQL, and SQL Database as an examples:
390390

391391
# [PostgreSQL](#tab/postgresql)
392392

@@ -396,6 +396,10 @@ App Service is a stateless hosting service, so you must put these steps into a s
396396

397397
[!INCLUDE [configure-jboss-mysql](includes/configure-language-java-data-sources/configure-jboss-mysql.md)]
398398

399+
# [SQL Database](#tab/sqldatabase)
400+
401+
[!INCLUDE [configure-jboss-sqldatabase](includes/configure-language-java-data-sources/configure-jboss-sql-database.md)]
402+
399403
---
400404

401405
::: zone-end

articles/app-service/configure-language-java-deploy-run.md

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -444,17 +444,20 @@ In your JBoss app's SSH session, you can run the JBoss CLI with the following co
444444
$JBOSS_HOME/bin/jboss-cli.sh --connect
445445
```
446446

447-
Depending on where JBoss is in the server lifecycle, you might not be able to connect. Wait a few minutes and try again. Note also that changes you make to the server with JBoss CLI doesn't persist after the app restarts. This approach is useful for quick checks of your current server state (for example, to see if a data source is properly configured).
447+
Depending on where JBoss is in the server lifecycle, you might not be able to connect. Wait a few minutes and try again. This approach is useful for quick checks of your current server state (for example, to see if a data source is properly configured).
448448

449-
The most reliable way to run JBoss CLI and persist your server changes is running it inside a startup script or a startup command. To do this, upload a file directly as a startup script. For an end-to-end example, see [Configure data sources for a Tomcat, JBoss, or Java SE app in Azure App Service](configure-language-java-data-sources.md?pivots=java-jboss).
449+
Also, changes you make to the server with JBoss CLI in the SSH session doesn't persist after the app restarts. Each time the app starts, the JBoss EAP server begins with a clean installation. During the [startup lifecycle](#jboss-server-lifecycle), App Service makes the necessary server configurations and deploys the app. To make any persistent changes in the JBoss server, use a [custom startup script or a startup command](#3-server-configuration-phase). For an end-to-end example, see [Configure data sources for a Tomcat, JBoss, or Java SE app in Azure App Service](configure-language-java-data-sources.md?pivots=java-jboss).
450450

451451
Alternatively, you can manually configure App Service to run any file on startup. For example:
452452

453453
```azurecli-interactive
454454
az webapp config set --resource-group <group-name> --name <app-name> --startup-file /home/site/scripts/foo.sh
455455
```
456456

457-
For more information about the CLI commands you can run, see the [Red Hat JBoss EAP documentation](https://docs.redhat.com/en/documentation/red_hat_jboss_enterprise_application_platform/8.0/html-single/getting_started_with_red_hat_jboss_enterprise_application_platform/index#management-cli-overview_assembly-jboss-eap-management).
457+
For more information about the CLI commands you can run, see:
458+
459+
- [Red Hat JBoss EAP documentation](https://docs.redhat.com/en/documentation/red_hat_jboss_enterprise_application_platform/8.0/html-single/getting_started_with_red_hat_jboss_enterprise_application_platform/index#management-cli-overview_assembly-jboss-eap-management)
460+
- [WildFly CLI Recipes](https://docs.jboss.org/author/display/WFLY/CLI%20Recipes.html)
458461

459462
## Clustering
460463

@@ -520,28 +523,28 @@ See respective sections below for details as well as opportunities to customize
520523
- If JBoss is launched in the `clustering` configuration:
521524
- Each JBoss instance receives an internal identifier between 0 and the number of instances that the app is scaled out to.
522525
- If some files are found in the transaction store path for this server instance (by using its internal identifier), it means this server instance is taking the place of an identical service instance that crashed previously and left uncommitted transactions behind. The server is configured to resume the work on these transactions.
523-
- Regardless of JBoss starting in the `clustering` or `standalone` configuration, if the server version is 7.4 or above, and the runtime uses Java 17, then the configuration is updated to enable the Elytron subsystem for security. <!-- using the JBoss CLI commands provided in the file docs/examples/enable-elytron-se17.cli -->
526+
- Regardless if JBoss starting in the `clustering` or `standalone` configuration, if the server version is 7.4 or above and the runtime uses Java 17, then the configuration is updated to enable the Elytron subsystem for security.
524527
- If you configure the app setting `WEBSITE_JBOSS_OPTS`, the value is passed to the JBoss launcher script. This setting can be used to provide paths to property files and more flags that influence the startup of JBoss.
525528

526529
### 3. Server configuration phase
527530

528-
- At the start of this phase, the startup script first waits for both the JBoss server and the admin interface to be ready to receive requests before continuing. This can take a few more seconds if App Insights is enabled.
529-
- When both JBoss Server and the admin interface are ready, it runs a JBoss CLI script to do the following:
530-
- Add the JBoss module `azure.appservice`, which provides utility classes for logging and integration with App Service.
531-
- Update the console logger to use a colorless mode so that log files aren't full of color escaping sequences.
532-
- Set up the integration with Azure Monitor logs.
533-
- Update the binding IP addresses of the WSDL and management interfaces.
534-
- Add the JBoss module `azure.appservice.easyauth` for integration with [App Service authentication](overview-authentication-authorization.md) and Microsoft Entra ID.
535-
- Update the logging configuration of access logs and the name and rotation of the main server log file.
536-
- Unless the app setting `WEBSITE_SKIP_AUTOCONFIGURE_DATABASE` is defined, the startup script performs autodetection of JDBC URLs in the App Service app settings. If valid JDBC URLs exist for PostgreSQL, MySQL, MariaDB, Oracle, or SQL Server, the startup script adds the corresponding driver(s) to the server and adds a data source for each of the JDBC URL. The JNDI name for each data source is `java:jboss/env/jdbc/<app-setting-name>_DS`, where `<app-setting-name>` is the name of the app setting.
537-
- If the `clustering` configuration is enabled, the startup script checks for the console logger to be configured. <!-- JBoss script /usr/local/appservice/lib/azure.appservice.clustering.cli will be run. At this time, the script only checks for the console logger to be configured. In the future some extra configuration specific for clustering could be added. -->
538-
- If there are JAR files deployed to the */home/site/libs* directory, a new global module is created adding all these JAR files.
539-
- Run the custom startup script, if one is provided. The script to use is determined, in order of precedence:
540-
- If you configured a startup command, run it.
541-
- If the path */home/site/scripts/startup.sh* exists, run it.
542-
- If the path */home/startup.sh* exists, run it.
543-
544-
The custom startup command or script runs as the root user (no need for `sudo`), so they can install Linux packages or launch the JBoss CLI to perform more JBoss install/customization commands (creating datasources, installing resource adapters), etc. For information on Ubuntu package management commands, see the [Ubuntu Server documentation](https://documentation.ubuntu.com/server/how-to/software/package-management/). ForJBoss CLI commands, see the [JBoss Management CLI Guide](https://docs.redhat.com/en/documentation/red_hat_jboss_enterprise_application_platform/7.4/html-single/management_cli_guide/index#how_to_cli).
531+
- At the start of this phase, App Service first waits for both the JBoss server and the admin interface to be ready to receive requests before continuing. This can take a few more seconds if Application Insights is enabled.
532+
- When both JBoss Server and the admin interface are ready, App Service does the following:
533+
- Adds the JBoss module `azure.appservice`, which provides utility classes for logging and integration with App Service.
534+
- Updates the console logger to use a colorless mode so that log files aren't full of color escaping sequences.
535+
- Sets up the integration with Azure Monitor logs.
536+
- Updates the binding IP addresses of the WSDL and management interfaces.
537+
- Adds the JBoss module `azure.appservice.easyauth` for integration with [App Service authentication](overview-authentication-authorization.md) and Microsoft Entra ID.
538+
- Updates the logging configuration of access logs and the name and rotation of the main server log file.
539+
- Unless the app setting `WEBSITE_SKIP_AUTOCONFIGURE_DATABASE` is defined, App Service autodetects JDBC URLs in the App Service app settings. If valid JDBC URLs exist for PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, or Azure SQL Database, it adds the corresponding driver(s) to the server and adds a data source for each of the JDBC URL and sets the JNDI name for each data source to `java:jboss/env/jdbc/<app-setting-name>_DS`, where `<app-setting-name>` is the name of the app setting.
540+
- If the `clustering` configuration is enabled, the console logger to be configured is checked.
541+
- If there are JAR files deployed to the */home/site/libs* directory, a new global module is created with all of these JAR files.
542+
- At the end of the phase, App Service runs the custom startup script, if one exists. The search logic for the custom startup script as follows:
543+
- If you configured a startup command (in the Azure portal, with Azure CLI, etc.), run it; otherwise,
544+
- If the path */home/site/scripts/startup.sh* exists, use it; otherwise,
545+
- If the path */home/startup.sh* exists, use it.
546+
547+
The custom startup command or script runs as the root user (no need for `sudo`), so they can install Linux packages or launch the JBoss CLI to perform more JBoss install/customization commands (creating datasources, installing resource adapters), etc. For information on Ubuntu package management commands, see the [Ubuntu Server documentation](https://documentation.ubuntu.com/server/how-to/software/package-management/). For JBoss CLI commands, see the [JBoss Management CLI Guide](https://docs.redhat.com/en/documentation/red_hat_jboss_enterprise_application_platform/7.4/html-single/management_cli_guide/index#how_to_cli).
545548

546549
### 4. App deployment phase
547550

articles/app-service/includes/configure-language-java-data-sources/configure-jboss-mysql.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ ms.author: cephalin
1010
1. Put your JBoss CLI commands into a file named *jboss-cli-commands.cli*. The JBoss commands must add the module and register it as a data source. The following example shows the JBoss CLI commands for creating a MySQL data source with the JNDI name `java:jboss/datasources/mysqlDS`.
1111

1212
```bash
13-
#!/bin/bash
1413
module add --name=com.mysql.mysql-connector-j --resources=/home/site/libs/mysql-connector-j-9.1.0.jar
1514
/subsystem=datasources/jdbc-driver=mysql:add(driver-name="mysql",driver-module-name="com.mysql.mysql-connector-j",driver-class-name="com.mysql.cj.jdbc.Driver",driver-xa-datasource-class-name="com.mysql.cj.jdbc.MysqlXADataSource")
1615
data-source add --name=mysql --driver-name="mysql" --jndi-name="java:jboss/datasources/mysqlDS" --connection-url="jdbc:mysql://\${env.DB_HOST}:5432/mysql?serverTimezone=UTC" --user-name="\${env.DB_USERNAME}" --password="\${env.DB_PASSWORD}" --enabled=true --use-java-context=true
@@ -77,6 +76,6 @@ ms.author: cephalin
7776

7877
---
7978

80-
To confirm that the datasource was added to the JBoss server, SSH into your webapp and run `$JBOSS_HOME/bin/jboss-cli.sh --connect`. Once you're connected to JBoss, run the `/subsystem=datasources:read-resource` to print a list of the data sources.
79+
To confirm that the data source was added to the JBoss server, SSH into your webapp and run `$JBOSS_HOME/bin/jboss-cli.sh --connect`. Once you're connected to JBoss, run the `/subsystem=datasources:read-resource` to print a list of the data sources.
8180
8281
As defined by *jboss-cli-commands.cli* previously, you can access the MySQL connection using the JNDI name `java:jboss/datasources/mysqlDS`.

articles/app-service/includes/configure-language-java-data-sources/configure-jboss-postgresql.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ ms.author: cephalin
1010
1. Put your JBoss CLI commands into a file named *jboss-cli-commands.cli*. The JBoss commands must add the module and register it as a data source. The following example shows the JBoss CLI commands for creating a PostgreSQL data source with the JNDI name `java:jboss/datasources/postgresDS`.
1111

1212
```bash
13-
#!/bin/bash
14-
module add --name=org.postgresql --resources=/home/site/libs/postgresql-42.7.1.jar
13+
module add --name=org.postgresql --resources=/home/site/libs/postgresql-42.7.4.jar
1514
/subsystem=datasources/jdbc-driver=postgresql:add(driver-name="postgresql",driver-module-name="org.postgresql",driver-class-name="org.postgresql.Driver",driver-xa-datasource-class-name="org.postgresql.xa.PGXADataSource")
1615
data-source add --name=postgresql --driver-name="postgresql" --jndi-name="java:jboss/datasources/postgresDS" --connection-url="jdbc:postgresql://\${env.DB_HOST}:5432/postgres" --user-name="\${env.DB_USERNAME}" --password="\${env.DB_PASSWORD}" --enabled=true --use-java-context=true
1716
```
@@ -33,7 +32,7 @@ ms.author: cephalin
3332
export APP_NAME=<app-name>
3433
3534
# The lib type uploads to /home/site/libs by default.
36-
az webapp deploy --resource-group $RESOURCE_GROUP_NAME --name $APP_NAME --src-path postgresql-42.7.1.jar --target-path postgresql-42.7.1.jar --type lib
35+
az webapp deploy --resource-group $RESOURCE_GROUP_NAME --name $APP_NAME --src-path postgresql-42.7.4.jar --target-path postgresql-42.7.4.jar --type lib
3736
az webapp deploy --resource-group $RESOURCE_GROUP_NAME --name $APP_NAME --src-path jboss_cli_commands.cli --target-path /home/site/scripts/jboss_cli_commands.cli --type static
3837
# The startup type uploads to /home/site/scripts/startup.sh by default.
3938
az webapp deploy --resource-group $RESOURCE_GROUP_NAME --name $APP_NAME --src-path startup.sh --type startup
@@ -51,7 +50,7 @@ ms.author: cephalin
5150
<type>lib</type>
5251
<directory>${project.build.directory}/${project.artifactId}/META-INF/lib</directory> <!-- Assume driver is part of POM dependencies. -->
5352
<includes>
54-
<include>postgresql-42.7.1.jar</include>
53+
<include>postgresql-42.7.4.jar</include>
5554
</includes>
5655
</resource>
5756
<resource>
@@ -77,6 +76,6 @@ ms.author: cephalin
7776

7877
---
7978

80-
To confirm that the datasource was added to the JBoss server, SSH into your webapp and run `$JBOSS_HOME/bin/jboss-cli.sh --connect`. Once you're connected to JBoss, run the `/subsystem=datasources:read-resource` to print a list of the data sources.
79+
To confirm that the data source was added to the JBoss server, SSH into your webapp and run `$JBOSS_HOME/bin/jboss-cli.sh --connect`. Once you're connected to JBoss, run the `/subsystem=datasources:read-resource` to print a list of the data sources.
8180
8281
As defined by *jboss-cli-commands.cli* previously, you can access the PostgreSQL connection using the JNDI name `java:jboss/datasources/postgresDS`.

0 commit comments

Comments
 (0)