Deploy Java WebSphere apps to Traditional WebSphere on Azure Virtual Machines
Članak
This article shows you how to deploy a Java WebSphere web app with sign-in by Microsoft Entra account to Traditional WebSphere on Azure Virtual Machines.
Prerequisites
Completion of one of the following articles for enabling security with Microsoft Entra ID:
When you deploy your application to WebSphere Application Server, your redirect URL changes to the redirect URL of your deployed WebSphere Application Server instance. Use the following steps to change these settings in your properties file:
Navigate to your app's authentication.properties file and change the value of app.homePage to your server URL and port number you're planning to use, as shown in the following example:
ini
# 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.netapp.homePage=https://<server-url>:<port-number>/msal4j-servlet-auth/
After saving this file, use the following command to rebuild your app:
Bash
mvn clean package
After the code finishes building, copy the .war file over to your target server's file system.
Update your Microsoft Entra ID app registration
Because the redirect URI changes to your deployed app on WebSphere, you also need to change the redirect URI in your Microsoft Entra ID app registration. Use the following steps to make this change:
Navigate to the Microsoft identity platform for developers App registrations page.
Use the search box to search for your app registration - for example, java-servlet-webapp-authentication.
Open your app registration by selecting its name.
Select Authentication from the menu.
In the Web - Redirect URIs section, select Add URI.
Fill out the URI of your web app, appending /auth/redirect - for example, https://<server-url>:<port-number>/auth/redirect.
Select Save.
Deploy the application
To deploy the application, use the following steps:
On the Applications tab, select New Application, then New Enterprise Application.
Choose the .war file you built, then select Next until you get to the Map context roots for Web modules installation step.
For the context root, set it to the same value as after the port number in the 'Redirect URI' you set in sample configuration/Azure app registration. That is, if the redirect URI is http://<server-url>:9080/msal4j-servlet-auth/, then the context root should just be msal4j-servlet-auth.
Select Finish.
After the application finishes installing, go to the WebSphere enterprise applications section of the Applications tab.
Select the .war file you installed from the list of applications and then select Start to deploy.
After it finishes deploying, navigate to http://<server-url>:9080/{whatever you set as the context root} and you should be able to see the application.
Pridružite se seriji susreta kako biste s kolegama programerima i stručnjacima izgradili skalabilna rješenja umjetne inteligencije temeljena na stvarnim slučajevima upotrebe.