Muokkaa

Jaa


Tutorial: Discover Spring Boot applications running in your datacenter (preview)

This article describes how to discover Spring Boot applications running on servers in your datacenter, using Azure Migrate: Discovery and assessment tool. The discovery process is completely agentless; no agents are installed on the target servers.

In this tutorial, you learn how to:

  • Set up Kubernetes based appliance for discovery of Spring Boot applications
  • Configure the appliance and initiate continuous discovery

Note

  • A Kubernetes-based appliance is required to discover Spring Boot applications. Learn more about scenarios covered by a Windows-based appliance.
  • Tutorials show you the quickest path for trying out a scenario. They use default options where possible.

If you don't have an Azure subscription, create a free account before you begin.

Supported geographies

Geography
Asia Pacific
Korea
Japan
United States
Europe
United Kingdom
Canada
Australia
France

Prerequisites

Set up Kubernetes-based appliance

After you have performed server discovery and software inventory using the Azure Migrate appliance, you can enable discovery of Spring Boot applications by setting up a Kubernetes appliance as follows:

Onboard Kubernetes-based appliance

  1. Go to the Azure portal. Sign in with your Azure account and search for Azure Migrate.

  2. On the Overview page > Servers, databases and web apps, select Discover, assess and migrate.

  3. Select the project where you set up the Azure Migrate appliance as part of the prerequisites.

  4. You see a message above Azure Migrate: Discovery and assessment tile to onboard a Kubernetes-based appliance to enable discovery of Spring Boot applications.

    Screenshot shows the banner for discovery and assessment of web apps.

  5. You can proceed by selecting the link on the message, which helps you get started with onboarding Kubernetes-based appliance.

    Note

    We recommend you choose a Kubernetes cluster with disk encryption for its services. Learn more about encrypting data at rest in Kubernetes.

  6. In Choose an appliance, you can select one from the following options:

    • Install appliance using packaged Kubernetes cluster - This option is selected by default as it is the recommended approach where the users can use the installer script to download and install a Kubernetes cluster on a Linux server on-premises to set up the appliance.
    • Bring your own Kubernetes cluster - You must bring your own Kubernetes cluster running on-premises, connect it to Azure Arc, and use the installer script to set up the appliance.
  1. In Provide appliance details for Azure Migrate, the appliance name is pre-populated, but you can choose to provide your own friendly name to the appliance.

    Screenshot that shows the Install appliance using packaged Kubernetes cluster option selected.

  2. Select a Key Vault from the drop-down or Create new Key vault. This Key Vault is used to process the credentials provided in the project to start discovery of Spring Boot applications.

    Note

    The Key Vault can be chosen or created in the same subscription and region as that of the Azure Migrate Project. When creating/selecting KV, make sure it does not have purge protection enabled else there be issues in processing of credentials through the Key Vault.

  3. After providing the appliance name and Key Vault, select Generate script to generate an installer script that you can copy and paste on a Linux server on-premises. Before executing the script, ensure that you meet the following prerequisites on the Linux server:

    Support Details
    Supported Linux OS Ubuntu 20.04, RHEL 9
    Hardware configuration required 8 GB RAM, with 30 GB storage, 4 Core CPU
    Network Requirements Access to the following endpoints:

    *.docker.io

    *.docker.com

    api.snapcraft.io

    https://dc.services.visualstudio.com/v2/track

    Azure Arc-enabled Kubernetes network requirements

    Azure CLI endpoints for proxy bypass

After copying the script, you can go to your Linux server, save the script as Deploy.sh on the server.

Connect using an outbound proxy server

If your machine is behind an outbound proxy server, requests must be routed via the outbound proxy server. Follow these steps to provide proxy settings:

  1. Open the terminal on the server and execute the following command to set up environment variables as a root user: sudo su -
  2. On the deployment machine, set the environment variables needed for deploy.sh to use the outbound proxy server:
    export HTTP_PROXY=”<proxy-server-ip-address>:<port>”
    export HTTPS_PROXY=”<proxy-server-ip-address>:<port>”
    export NO_PROXY=””
    
  3. If your proxy uses a certificate, provide the absolute path to the certificate. export PROXY_CERT=””

Note

The machine uses proxy details while installing the required prerequisites to run the deploy.sh script . It won't override the proxy settings of the Azure Arc-enabled Kubernetes cluster.

Execute the installer script

After you save the script on the Linux server, follow these steps:

Note

This script needs to be run after you connect to a Linux machine on its terminal that has met the networking pre-requisite and OS compatibility.
Ensure that you have curl installed on the server. For Ubuntu, you can install it using the command sudo apt-get install curl, and for other OS (RHEL), you can use the command yum install curl.

Important

Don't edit the script unless you want to clean up the setup.

  1. Open the Terminal on the server and execute the following command to execute the script as a root user: sudo su -

  2. Change the directory to where you saved the script and execute the script using command: bash deploy.sh

  3. Follow the instructions in the script and sign in with your Azure user account when prompted.

  4. The script performs the following steps:

    1. Installing required CLI extensions.
    2. Registering Azure Resource Providers
    3. Checking for prerequisites like connectivity to required endpoints
    4. Setting up MicroK8s Kubernetes cluster
    5. Installing the required operators on the cluster
    6. Creating the required Migrate resources
  5. After the script is executed successfully, configure the appliance through the portal.

Reinstallation

Note

If you encounter any issue during script execution, you need to re-run the script and it would resume from last successful state. In case you want to perform a complete fresh install, see cleanup of setup details before you re-run the script.

Encryption at rest

As you're setting a packaged appliance, we have shared responsibility to ensure that the secrets are secured.

  • We recommend you choose a Linux VM with disk encryption for its services.

Configure Kubernetes-based appliance

After successfully setting up the appliance using the installer script, you need to configure the appliance by following these steps:

  1. Go to the Azure Migrate project where you started onboarding the Kubernetes-based appliance.

  2. On the Azure Migrate: Discovery and assessment tile, select the appliance count for Pending action under appliances summary.

    Screenshot displays the Pending action option.

  3. In Overview > Manage > Appliances, a filtered list of appliances appears with actions pending.

  4. Find the Kubernetes-based appliance that you set up and select Credentials unavailable status to configure the appliance.

    Screenshot displays the details of the appliance.

  5. In the Manage credentials page, add the credentials to initiate discovery of the Spring Boot applications running on your servers.

    Screenshot displays the Manage credentials option.

  6. Select Add credentials, choose a credential type from Linux (non-domain) or Domain credentials, provide a friendly name, username, and password. Select Save.

    Note

    • The credentials added on the portal are processed via the Azure Key Vault chosen in the initial steps of onboarding the Kubernetes-based appliance. The credentials are then synced (saved in an encrypted format) to the Kubernetes cluster on the appliance and removed from the Azure Key Vault.
    • After the credentials are successfully synced, they would be used for discovery of the specific workload in the next discovery cycle.
  7. After adding a credential, you need to refresh the page to see the Sync status of the credential. If status is Incomplete, you can select the status to review the error encountered and take the recommended action. After the credentials are successfully synced, wait for 24 hours before you can review the discovered inventory by filtering for the specific workload in the Discovered servers page.

    Note

    You can add/update credentials any time by navigating to Azure Migrate: Discovery and assessment > Overview > Manage > Appliances page, selecting Manage credentials from the options available in the Kubernetes-based appliance.

Cleanup of setup

To cleanup, run the following script in delete mode:

In the script generated by the portal, after all the user arguments (after line 19 in the following image), add export DELETE= “true” and run the same script again. This cleans up all existing components created during appliance creation.

Screenshot shows delete mode.

Overview of Discovery results

The Discovered servers screen provides the following information:

  • Displays all running Spring Boot workloads on your server-based environment.
  • Lists the basic information of each server in a table format.

Screenshot displays the discovered servers.

Select any web app to view its details. The Web apps screen provides the following information:

  • Provides a comprehensive view of each Spring Boot process on each server.
  • Displays the detailed information of each process, including:
    • JDK version and Spring Boot version.
    • Environment variable names and JVM options that are configured.
    • Application configuration and certificate files in use.
    • Location of JAR file for the process on the server.
    • Static content locations and binding ports.

Screenshot displays the Web apps screen.

Next steps