Muokkaa

Jaa


Deploy Java WebLogic apps to WebLogic on Azure Virtual Machines

This article shows you how to deploy a Java WebLogic web app with sign-in by Microsoft Entra account to WebLogic on Azure Virtual Machines.

Prerequisites

Prepare the app for deployment

When you deploy your application to Oracle WebLogic Server, your redirect URL changes to the redirect URL of the app on the Oracle WebLogic Server instance. Use the following steps to change these settings in your properties file:

  1. Navigate to your app's authentication.properties file and change the value of app.homePage to your deployed app's domain name, as shown in the following example. This domain name has the form http://<vm-host-name>:<port>/<your-app-path>. You can get the host name and port from adminConsoleURL by removing /console/. If you're using the recommended sample app, the URL should be http://<vm-host-name>:<port>/testwebapp/, which should be similar to http://wls-5b942e9f2a-admindomain.westus.cloudapp.azure.com:7001/testwebapp/.

    # app.homePage is by default set to dev server address and app context path on the server
    # for apps deployed to azure, use https://your-sub-domain.azurewebsites.net
    app.homePage=http://<vm-host-name>:<port>/<your-app-path>
    
  2. After saving this file, use the following command to rebuild your app:

    mvn clean package
    
  3. After rebuilding the app, follow the steps of Deploy a Java EE application from Administration Console portal to redeploy the application with your current .war file.

Update your Microsoft Entra ID app registration

Because the redirect URI changes to your deployed app on Oracle WebLogic Server, you also need to change the redirect URI in your Microsoft Entra ID app registration. Use the following steps to make this change:

  1. Navigate to the Microsoft identity platform for developers App registrations page.

  2. Use the search box to search for your app registration - for example, java-servlet-webapp-authentication.

  3. Open your app registration by selecting its name.

  4. Select Authentication from the menu.

  5. In the Web - Redirect URIs section, select Add URI.

  6. Fill out the URI of your web app, appending /auth/redirect - for example, http://wls-5b942e9f2a-admindomain.westus.cloudapp.azure.com:7001/testwebapp/auth/redirect.

  7. Select Save.

Your deployment is now complete.

More information