Update the Java application in an existing Oracle WebLogic Server cluster

This page documents how to update an existing deployment of Oracle WebLogic Server with a Java EE applications using Azure CLI.

You can invoke this ARM template to:

The template will only update the application deployments in the Oracle WebLogic Server cluster, without any change to other configuration.

Prerequisites

Environment for Setup

Azure Managed Identity

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.

WebLogic Server Instance

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.

Azure Storage account

If you are deploying a Java EE application or using your own JDBC data source driver, you are required to have application packages and JDBC libraries uploaded to a blob storage container in an Azure Storage Account.

To create Azure Storage Account and blobs, follow the steps in Quickstart: Upload, download, and list blobs with the Azure portal.

Upload your application packages (.jar, .war, .ear files) to the blob.

Upload your JDBC drivers (.jar files) to the blob.

Prepare the Parameters JSON file

Advanced parameter Name Explanation
_artifactsLocation Required. See below for details.
acrName Required. String value.
Name of Azure Container Registry that is used to managed the WebLogic domain images.
aksClusterName Required. String value.
Name of the AKS cluster. Must be the same value provided at deployment time.
aksClusterRGName Required. String value.
Name of resource group that contains the (AKS) instance, probably the resource group you are working on. It’s recommended to run this template in the same resource group that runs AKS.
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.
wlsDomainName Required. String value.
Password for WebLogic Administrator. Make sure it’s the same with the initial cluster deployment.
wlsDomainUID Required. String value.
User name for WebLogic Administrator. Make sure it’s the same with the initial cluster deployment.
appPackageUrls Optinal. Array.
String array of Java EE applciation location, which can be downloaded using “curl”. Currently, only support URLs of Azure Storage Account blob.
appPackageFromStorageBlob Optinal. Object value.
Key storageAccountName specify the storage account name, the template will download application package from this storage account.
Key containerName specify the container name that stores the Java EE application.
ocrSSOPSW Optional. String value.
Password for Oracle SSO account.
ocrSSOUser Optional. String value.
User name for Oracle SSO account.
wlsImageTag Optional. String value.
Docker tag that comes after “container-registry.oracle.com/middleware/weblogic:”.
userProvidedAcr Optional. String value.
User provided ACR for base image.
userProvidedImagePath Optional. String value.
User provided base image path.
useOracleImage Optional. Boolean value.
true: use Oracle standard images from Oracle Container Registry.
false: use user provided images from Azure Container Registry.

_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/

Java EE application location

The template supports two approaches to specify the location of Java EE application. The template will update the cluter with applications specified in appPackageUrls and appPackageFromStorageBlob.

SAS URLs

You can specify the application URLs via appPackageUrls. The template only supports url from Azure Storage Account. Make sure the URLs are accessible from public network. You may want to update one application, but you must include all the application SAS URLs in the parameter. If you are removing an application, do not include the application url.

Steps to obtain SAS URLs:

Storage Account Blob

You can also specify the contaier of Storage Account. The template will download all the .jar, .war. .ear files from the container.

You may want to update one application, but you must include all the application in the container. If you want to remove an application, do not include the application.

Steps to upload your applications to blob:

You can define the application location using both approaches, but it’not suggested. The template will download applications from appPackageUrls and appPackageFromStorageBlob.

Base image location

The template supports two kinds of base image:

Oracle Standard image

If you are using Oracle Standard image, you must provide the following parameters:

User provided image

If you are bringing your own image, you must provide the following parameters:

Example Parameters JSON

This is an example to deploy Java EE application in samplecontainer to the Oracle WebLogic Server cluster, using Oracle base image. The parameters using default value haven’t been shown for brevity.

{
    "_artifactsLocation": {
        "value": "https://raw.githubusercontent.com/oracle/weblogic-azure/2024-02-29-1-Q1/weblogic-azure-aks/src/main/arm/"
    },
    "acrName": {
      "value": "sampleacr"
    },
    "aksClusterRGName": {
      "value": "sampleaksgroup"
    },
    "aksClusterName": {
      "value": "sampleaks"
    },
    "appPackageFromStorageBlob": {
      "value": {
        "storageAccountName": "samplestorage",
        "containerName": "samplecontainer"
      }
    },
    "identity": {
      "value": {
        "type": "UserAssigned",
        "userAssignedIdentities": {
          "/subscriptions/subscription-id/resourceGroups/samples/providers/Microsoft.ManagedIdentity/userAssignedIdentities/azure_wls_aks": {}
        }
      }
    },
    "ocrSSOPSW": {
      "value": "Secret123!"
    },
    "ocrSSOUser": {
      "value": "foo@example.com"
    }
  }

Invoke the ARM template

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.

Validate your parameters file

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/updateAppTemplate.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.

Execute the template

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/updateAppTemplate.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.

Verify application

Visit the application via cluster address, you should find your application have been updated.