Deploy a Java application with WebLogic Server on an Azure Kubernetes Service (AKS) cluster
This article shows you how to quickly deploy WebLogic Application Server (WLS) on Azure Kubernetes Service (AKS) with the simplest possible set of configuration choices using the Azure portal. For a more full featured tutorial, including the use of Azure Application Gateway to make WLS on AKS securely visible on the public Internet, see Tutorial: Migrate a WebLogic Server cluster to Azure with Azure Application Gateway as a load balancer.
For step-by-step guidance in setting up WebLogic Server on Azure Kubernetes Service, see the official documentation from Oracle at Azure Kubernetes Service.
Prerequisites
- If you don't have an Azure subscription, create an Azure free account before you begin.
- Ensure the Azure identity you use to sign in and complete this article has either the Owner role in the current subscription or the Contributor and User Access Administrator roles in the current subscription. For an overview of Azure roles, see What is Azure role-based access control (Azure RBAC)? For details on the specific roles required by WLS on AKS, see Azure built-in roles.
- Have the credentials for an Oracle single sign-on (SSO) account. To create one, see Create Your Oracle Account.
- Accept the license terms for WLS.
- Visit the Oracle Container Registry and sign in.
- If you have a support entitlement, select Middleware, then search for and select weblogic_cpu.
- If you don't have a support entitlement from Oracle, select Middleware, then search for and select weblogic.
Note
Get a support entitlement from Oracle before going to production. Failure to do so results in running insecure images that are not patched for critical security flaws. For more information on Oracle's critical patch updates, see Critical Patch Updates, Security Alerts and Bulletins from Oracle.
- Accept the license agreement.
Create a storage account and storage container to hold the sample application
Use the following steps to create a storage account and container. Some of these steps direct you to other guides. After completing the steps, you can upload a sample application to run on WLS on AKS.
- Download a sample application as a .war or .ear file. The sample app should be self-contained and not have any database, messaging, or other external connection requirements. The sample app from the WLS Kubernetes Operator documentation is a good choice. You can download testwebapp.war from Oracle. Save the file to your local filesystem.
- Sign in to the Azure portal.
- Create a storage account by following the steps in Create a storage account. You don't need to perform all the steps in the article. Just fill out the fields as shown on the Basics pane, then select Review + create to accept the default options. Proceed to validate and create the account, then return to this article.
- Create a storage container within the account. Then, upload the sample application you downloaded in step 1 by following the steps in Quickstart: Upload, download, and list blobs with the Azure portal. Upload the sample application as the blob, then return to this article.
Deploy WLS on AKS
The steps in this section direct you to deploy WLS on AKS in the simplest possible way. WLS on AKS offers a broad and deep selection of Azure integrations. For more information, see What are solutions for running Oracle WebLogic Server on the Azure Kubernetes Service?
The following steps show you how to find the WLS on AKS offer and fill out the Basics pane.
In the search bar at the top of the Azure portal, enter weblogic. In the auto-suggested search results, in the Marketplace section, select Oracle WebLogic Server on Azure Kubernetes Service.
You can also go directly to the Oracle WebLogic Server on Azure Kubernetes Service offer.
On the offer page, select Create.
On the Basics pane, ensure the value shown in the Subscription field is the same one that has the roles listed in the prerequisites section.
You must deploy the offer in an empty resource group. In the Resource group field, select Create new and then fill in a value for the resource group. Because resource groups must be unique within a subscription, pick a unique name. An easy way to have unique names is to use a combination of your initials, today's date, and some identifier - for example, `ejb0723wls``.
Under Instance details, select the region for the deployment. For a list of Azure regions where AKS is available, see AKS region availability.
Under Credentials for WebLogic, leave the default value for Username for WebLogic Administrator.
Fill in
wlsAksCluster2022
for the Password for WebLogic Administrator. Use the same value for the confirmation and Password for WebLogic Model encryption fields.Scroll to the bottom of the Basics pane and notice the helpful links for documentation, community support, and how to report problems.
Select Next: AKS.
The following steps show you how to start the deployment process.
Scroll to the section labeled Provide an Oracle Single Sign-On (SSO) account. Fill in your Oracle SSO credentials from the preconditions.
In the Application section, next to Deploy an application?, select Yes.
Next to Application package (.war,.ear,.jar), select Browse.
Start typing the name of the storage account from the preceding section. When the desired storage account appears, select it.
Select the storage container from the preceding section.
Select the checkbox next to the sample app uploaded from the preceding section. Select Select.
The following steps make it so the WLS admin console and the sample app are exposed to the public Internet with a built-in Kubernetes LoadBalancer
service. For a more secure and scalable way to expose functionality to the public Internet, see Tutorial: Migrate a WebLogic Server cluster to Azure with Azure Application Gateway as a load balancer.
Select the Load balancing pane.
Next to Load Balancing Options, select Standard Load Balancer Service.
In the table that appears, under Service name prefix, fill in the values as shown in the following table. The port values of 7001 for the admin server and 8001 for the cluster must be filled in exactly as shown.
Service name prefix Target Port console admin-server 7001 app cluster-1 8001 Select Review + create. Ensure the green Validation Passed message appears at the top. If it doesn't, fix any validation problems, then select Review + create again.
Select Create.
Track the progress of the deployment on the Deployment is in progress page.
Depending on network conditions and other activity in your selected region, the deployment may take up to 30 minutes to complete.
Examine the deployment output
The steps in this section show you how to verify that the deployment has successfully completed.
If you navigated away from the Deployment is in progress page, the following steps will show you how to get back to that page. If you're still on the page that shows Your deployment is complete, you can skip to the steps after the image below.
In the upper left of any portal page, select the hamburger menu and select Resource groups.
In the box with the text Filter for any field, enter the first few characters of the resource group you created previously. If you followed the recommended convention, enter your initials, then select the appropriate resource group.
In the left navigation pane, in the Settings section, select Deployments. You'll see an ordered list of the deployments to this resource group, with the most recent one first.
Scroll to the oldest entry in this list. This entry corresponds to the deployment you started in the preceding section. Select the oldest deployment, as shown in the following screenshot.
In the left panel, select Outputs. This list shows the output values from the deployment. Useful information is included in the outputs.
The adminConsoleExternalUrl value is the fully qualified, public Internet visible link to the WLS admin console for this AKS cluster. Select the copy icon next to the field value to copy the link to your clipboard. Save this value aside for later.
The clusterExternalUrl value is the fully qualified, public Internet visible link to the sample app deployed in WLS on this AKS cluster. Select the copy icon next to the field value to copy the link to your clipboard. Save this value aside for later.
The other values in the outputs are beyond the scope of this article, but are explained in detail in the WebLogic on AKS user guide.
Verify the functionality of the deployment
The following steps show you how to verify the functionality of the deployment by viewing the WLS admin console and the sample app.
Paste the value for adminConsoleExternalUrl in an Internet-connected web browser. You should see the familiar WLS admin console login screen as shown in the following screenshot.
Note
This article shows the WLS admin console merely by way of demonstration. Don't use the WLS admin console for any durable configuration changes when running WLS on AKS. The cloud-native design of WLS on AKS requires that any durable configuration must be represented in the initial docker images or applied to the running AKS cluster using CI/CD techniques such as updating the model, as described in the Oracle documentation.
Understand the
context-path
of the sample app you deployed. If you deployed the recommended sample app, thecontext-path
istestwebapp
.Construct a fully qualified URL for the sample app by appending the
context-path
to the value of clusterExternalUrl. If you deployed the recommended sample app, the fully qualified URL will be something likehttp://123.456.789.012:8001/testwebapp/
.Paste the fully qualified URL in an Internet-connected web browser. If you deployed the recommended sample app, you should see results similar to the following screenshot.
Clean up resources
To avoid Azure charges, you should clean up unnecessary resources. When you no longer need the cluster, use the az group delete command. The following command will remove the resource group, container service, container registry, and all related resources.
az group delete --name <resource-group-name> --yes --no-wait
Next steps
Learn more about running WLS on AKS or virtual machines by following these links:
Feedback
Submit and view feedback for