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:
Update a running Java EE application with new version.
Remove a running Java EE application.
Deploy a new Java EE application.
The template will only update the application deployments in the Oracle WebLogic Server cluster, without any change to other configuration.
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 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.
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/
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
.
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:
Open your Storage Account from Azure portal. If you don’t have, please follow this guide to create one.
Open your container. If you don’t have, please follow this guide to create one.
You should find your application listed. If not, please upload your application package to the container:
Click Upload
Select the application file
Click Upload
Click your application, and click Generate SAS.
Signing method: Account key
Signing key: Key 1
Permisson: Read
Click Generate SAS token and URL
Copy the Blob SAS URL and save it to a file.
Repeat step 4 for other applicatios.
Now you have all the URLs. appPackageUrls
will be value like ["sasUrl1", "sasUrl2"]
.
It should present in parameters.json like:
{
"appPackageUrls": {
"value": [
"sasUrl1",
"sasUrl2"
]
}
}
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:
Open your storage account from Azure portal. If you don’t have, please follow guide to create one.
Create a new container follow guide you may name it javaeeapps
.
Upload your application to the container.
Now you can specify the value of storage blob:
storageAccountName
: name of your Storage Account
containerName
: container name, should be javaeeapps
if you use the name in step 2.
It should present in parameters.json like:
{
"appPackageFromStorageBlob": {
"value": {
"storageAccountName": "<your-storage-account-name>",
"containerName": "<your-container-name>"
}
}
}
You can define the application location using both approaches, but it’not suggested. The template will download
applications from appPackageUrls
and appPackageFromStorageBlob
.
The template supports two kinds of base image:
Oracle Standard image from Oracle Container Registry (OCR)
User provided image from Azure Container Registry (ACR)
If you are using Oracle Standard image, you must provide the following parameters:
ocrSSOPSW
: Password for Oracle SSO account. The template will use the account to pull image from OCR.
ocrSSOUser
: User id for Oracle SSO account. The template will use the account to pull image from OCR.
wlsImageTag
: weblogic image tag, the available tags are listed in Oracle WebLogic Server images. Default value is 12.2.1.4
.
If you are bringing your own image, you must provide the following parameters:
userProvidedAcr
: ACR name that contains your image. The acrName
should be the same ACR name.
userProvidedImagePath
: image path in ACR.
useOracleImage
: false
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"
}
}
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/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.
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.
Visit the application via cluster address, you should find your application have been updated.