This page documents how to configure an existing deployment of Oracle WebLogic Server with an existing Azure database using Azure CLI.
You can invoke the database ARM template to:
Create a new data source connection, you can have multiple data source connections in your cluster.
Update an existing data source connection.
Delete an existing data source connection.
az --version
to test if az
works.You are required to input the ID of a user-assigned managed identity that has the Contributor at the subscription level of the current subscription.
To create a user-assigned managed identity, follow the steps in Manage user-assigned managed identities.
You will need the resource ID of the identity. To obtain ID of the identity: go to Azure Portal; open the identity Overview page; select JSON View and copy the Resource ID.
The database ARM template will be applied to an existing Oracle WebLogic Server instance. If you don’t have one, please create a new instance from the Azure portal, by following the link to the offer in the index.
If you are using your own data source driver, make sure the data source driver is uploaded during the WebLogic Server instance provisioning.
You can create an Oracle WebLogic Server cluster with data source driver library with steps:
Input values to Basics and Config AKS cluster blade
In the Database blade, select Yes to connect to database. For Choose databse type, select Other, upload data source driver in data source driver.
Finish other inputs, create Review + create to provison a cluster.
You will get an Oracle WebLogic Server cluster with your data source driver built in the image.
To apply a database with Oracle WebLogic Server, you must have an existing database instance to use.
The marketplace offer ships with database driver for Oracle, Azure SQL Server, Azure Database for PostgreSQL and MySQL. You can invoke the dbTemplate to create data source connection for those database. If you do not have an instance, please create one from Azure portal. You are able to provision a MySQL instance quickly using Azure Database for MySQL.
Besides Oracle, Azure SQL Server, Azure Database for PostgreSQL and MySQL, you are able to create data source connection using other databases, such as IBM Informix and MariaDB, but you have to follow those steps to achieve that:
Create your database server, and make sure the database is accessible from Azure.
Ship your database driver to the Oracle WebLogic Server cluster. The only approach to upload a data source driver is using marketplace offer. The offer enables you to bring your own data source driver. See WebLogic Server Instance
Invoke the dbTemplate to update an existing data source connection or create another new data source connection.
You may want to enable multiple data source in your cluster for the following usage:
You can deploy different data source connections using the database ARM template, by changing the ARM parameters file and invoking the template again with Azure CLI.
To deploy data source using your own data source driver, we assume the data source driver has been uploaded to the cluster. See WebLogic Server Instance
Advanced parameter Name | Explanation |
---|---|
_artifactsLocation |
Required. See below for details. |
aksClusterName |
Required. String value. Name of the AKS cluster. Must be the same value provided at deployment time. |
dbPassword |
Required. String value. Password for the data source connection. |
dbUser |
Required. String value. User id for the data source connection. |
dsConnectionURL |
Required. String value. JDBC connection string. |
identity |
Required. Object value. Azure user managed identity used, make sure the identity has permission to create/update/delete Azure resources. It’s recommended to assign “Contributor” role. |
jdbcDataSourceName |
Required. String value. JDBC name for the data source connection. |
wlsDomainUID |
Required. String value. UID of the domain that you are going to update. Make sure it’s the same with the initial cluster deployment. |
wlsPassword |
Required. String value. Password for WebLogic Administrator. Make sure it’s the same with the initial cluster deployment. |
wlsUserName |
Required. String value. User name for WebLogic Administrator. Make sure it’s the same with the initial cluster deployment. |
databaseType |
Optinal. Enum value. Defaults by oracle . oracle : will provision a Oracle datasoruce connection. postgresql : will provision a Azure Database for PostgreSQL data source connection.sqlserver : will provision a Azure SQL Server data source connection. mysql : will provision a MySQL data source connection. |
dbConfigurationType |
Optinal. Enum value. Defaults by createOrUpdate . createOrUpdate : the deployment will create a new data source connection if there is no data source has the same name with jdbcDataSourceName , otherwise, will update the expected data source with new inputs. delete : the deployment will delete a data source connection that has name jdbcDataSourceName |
dbGlobalTranPro |
Optinal. Enum value. Defaults by OnePhaseCommit . The transaction protocol (global transaction processing behavior) for the data source. You may use one from: ["TwoPhaseCommit", "LoggingLastResource", "OnePhaseCommit", "None"] |
_artifactsLocation
This value must be the following.
https://raw.githubusercontent.com/oracle/weblogic-azure/2024-02-29-1-Q1/weblogic-azure-aks/src/main/arm/
The parameter dsConnectionURL
stands for JDBC connection string. The connection string is database specific.
The following is the format of the JDBC connection string for Oracle Database:
jdbc:oracle:thin:@HOSTNAME:1521/DATABASENAME
For example:
jdbc:oracle:thin:@benqoiz.southeastasia.cloudapp.azure.com:1521/pdb1
Deploy an Azure Database PostgreSQL as described in Create an Azure Database for PostgreSQL server in the Azure portal.
Access the Azure portal, and go to the service instance.
Click Connection Strings under Settings.
Locate the JDBC section and click the copy icon on the right to copy the JDBC connection string to the clipboard. The JDBC connection string will be similar to the following:
jdbc:postgresql://20191015cbfgterfdy.postgres.database.azure.com:5432/{your_database}?user=jroybtvp@20191015cbfgterfdy&password={your_password}&sslmode=require
When passing this value to the ARM template, remove the database user and password values from the connection string, and let them be the parameters dbUser
and dbPassword
. In the above JDBC connection string sample, the value for dsConnectionURL
argument after removing the database user and password, will be:
jdbc:postgresql://20191015cbfgterfdy.postgres.database.azure.com:5432/{your_database}?sslmode=require
Finally, replace {your_database}
with the name of your database, typically postgres
.
Deploy Azure SQL Server as described in Create a single database in Azure SQL Database using the Azure portal, PowerShell, and Azure CLI.
Access the Azure portal and go to the service instance.
Click Connection Strings under Settings.
Locate the JDBC section and click the copy icon on the right to copy the JDBC connection string to the clipboard. The JDBC connection string will be similar to the following:
jdbc:sqlserver://rwo102804.database.windows.net:1433;database=rwo102804;user=jroybtvp@rwo102804;password={your_password_here};encrypt=true;trustServerCertificate=false;hostNameInCertificate=*.database.windows.net;loginTimeout=30;
When passing this value to the ARM template, remove the database user and password values, let them be the parameters dbUser
and dbPassword
. In the above JDBC connection string sample, the value for dsConnectionURL
argument after removing the database user and password, will be:
jdbc:sqlserver://rwo102804.database.windows.net:1433;database={your_database};encrypt=true;tr
Finally, replace {your_database}
with the name of your database.
Deploy Azure Database for MySQL as described in Create an Azure Database for MySQL server by using the Azure portal.
Access the Azure portal and go to the service instance.
Note that, for Azure Database for MySQL, you need to add @<servername> to the admin user name, similar to weblogic@contoso
.
Click Connection Strings under Settings.
Locate the JDBC section and click the copy icon on the right to copy the JDBC connection script to the clipboard. The JDBC connection string will be the value of url, similar to the following:
jdbc:mysql://contoso.mysql.database.azure.com:3306/{your_database}?useSSL=true&requireSSL=false
Next, replace {your_database}
with the name of your database.
You have to append arguments according to the WLS version you are using.
If you are using Patched WebLogic Server Images from Oracle Container Registry middleware/weblogic_cpu repository, you have to specify serverTimezone, like the following:
jdbc:mysql://contoso.mysql.database.azure.com:3306/guest?useSSL=true&requireSSL=false&serverTimezone=UTC
If you are using General WebLogic Server Images from Oracle Container Registry middleware/weblogic repository, you have to specify serverTimezone and enabledTLSProtocols, like the following:
jdbc:mysql://contoso.mysql.database.azure.com:3306/guest?useSSL=true&requireSSL=false&serverTimezone=UTC&enabledTLSProtocols=TLSv1.2
{
"_artifactsLocation": {
"value": "https://raw.githubusercontent.com/oracle/weblogic-azure/2024-02-29-1-Q1/weblogic-azure-aks/src/main/arm/"
},
"aksClusterName": {
"value": "aks-sample"
},
"databaseType": {
"value": "postgresql"
},
"dbConfigurationType": {
"value": "createOrUpdate"
},
"dbPassword": {
"value": "Secret123!"
},
"dbUser": {
"value": "postgres@sampledb"
},
"dsConnectionURL": {
"value": "jdbc:postgresql://sampledb.postgres.database.azure.com:5432/postgres?sslmode=require"
},
"identity": {
"value": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/subscription-id/resourceGroups/samples/providers/Microsoft.ManagedIdentity/userAssignedIdentities/azure_wls_aks": {}
}
}
},
"jdbcDataSourceName": {
"value": "jdbc/WebLogicDB"
},
"wlsDomainUID": {
"value": "sample-domain1"
},
"wlsPassword": {
"value": "Secret123!"
},
"wlsUserName": {
"value": "weblogic"
}
}
Assume your parameters file is available in the current directory and is named parameters.json
. This section shows the commands to configure your Oracle WebLogic Server deployment with the specified database. Replace yourResourceGroup
with the Azure resource group in which the Oracle WebLogic Server is deployed.
The az group deployment validate
command is very useful to validate your parameters file is syntactically correct.
az deployment group validate --verbose \
--resource-group `yourResourceGroup` \
--parameters @parameters.json \
--template-uri https://raw.githubusercontent.com/oracle/weblogic-azure/2024-02-29-1-Q1/weblogic-azure-aks/src/main/arm/dbTemplate.json
If the command returns with an exit status other than 0
, inspect the output and resolve the problem before proceeding. You can check the exit status by executing the commad echo $?
immediately after the az
command.
After successfully validating the template invocation, change validate
to create
to invoke the template.
az deployment group create --verbose \
--resource-group `yourResourceGroup` \
--parameters @parameters.json \
--template-uri https://raw.githubusercontent.com/oracle/weblogic-azure/2024-02-29-1-Q1/weblogic-azure-aks/src/main/arm/dbTemplate.json
As with the validate command, if the command returns with an exit status other than 0
, inspect the output and resolve the problem.
For a successful deployment, you should find "provisioningState": "Succeeded"
in your output.
Follow the steps to check if the database has successfully been connected.
jdbc/WebLogicDB
.admin
and select Test Data Source