Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update pictures
  • Loading branch information
yiliuTo committed May 23, 2025
commit ab86a42ad7a4190d32f079d822585d049b4a1667
21 changes: 17 additions & 4 deletions asset-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@

GitHub Copilot App Modernization for Java (Preview), also referred to as `App Modernization for Java`, assists with app assessment, planning and code remediation. It automates repetitive tasks, boosting developer confidence and speeding up the Azure migration and ongoing optimization.

In this workshop, you learn how to use GitHub Copilot App Modernization for Java (Preview) to assess and migrate a sample Java application `asset-manager` to Azure. For more information about this sample application, see [Asset Manager](README.md).
In this workshop, you learn how to use GitHub Copilot App Modernization for Java (Preview) to assess and migrate a sample Java application `asset-manager` to Azure.

## About this Project

This application consists of two sub-modules, **Web** and **Worker**. Both of them contain functions of using storage service and message queue. To demonstrate the migration process, this GitHub repository is mainly composed of 3 different branches:

- [`source`](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/source/asset-manager) branch: The original project before being migrated to Azure service.
- [`main`](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/main/asset-manager) branch: Only the `web` module is migrated to use Azure service.
- [`expected`](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/expected/asset-manager) branch: The final project that both `web` and `worker` modules are migrated to Azure.
- [`main`](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/main/asset-manager) branch: Only the `web` module is migrated to use Azure service. This branch will be used for the workshop.
- [`expected`](https://github.com/Azure-Samples/java-migration-copilot-samples/tree/expected/asset-manager) branch: The is the final migrated state, and both `web` and `worker` modules are migrated to Azure.

### Original Infrastructure

Expand Down Expand Up @@ -223,7 +223,8 @@ The first step is to assess the sample Java application `asset-manager`. The ass

1. Open the VS code with all the prerequisites installed on the asset manager by changing the directory to the `asset-manager` directory and running `code .` in that directory.
1. Open the extension `App Modernization for Java`.
1. Hover the mouse over the **Assessment** section and click **Assess** button which looks like a triangle pointing right. Then, the Github Copilot Chat window will be opened and propose to run Modernization Assessor. Please confirm the tool usage by clicking **Continue**.
1. Hover the mouse over the **Assessment** section and click **Assess** button which looks like a triangle pointing right. Then, the Github Copilot Chat window will be opened and propose to run Modernization Assessor. Please confirm the tool usage by clicking **Continue**.

![Trigger Assessment](doc-media/trigger-assessment.png)

> **NOTE**: If you are asked to allow the tool access the language models provided by GitHub Copilot Chat, select **Allow** to proceed.
Expand All @@ -232,7 +233,9 @@ The first step is to assess the sample Java application `asset-manager`. The ass
1. Wait for the assessment to be completed and the report to be generated.
1. Review the **Summary** report. Select **Propose Solution** to view the proposed solutions for the issues identified in the summary report.
1. For this workshop, deselect all solutions and select **Migrate to Azure Database for PostgreSQL (SDK on Public Cloud)** in the Solution report, then select **Confirm Solution**.

![Confirm Solution](doc-media/confirm-postgresql-solution.png)

1. In the Migrate report, click **Migrate**.

### Migrate to Azure Database for PostgreSQL Flexible Server using Predefined Formula
Expand All @@ -251,21 +254,31 @@ The Application `asset-manager` used AWS S3 for image storage and Spring AMQP wi
The following steps demonstrate how to generate custom formulas based on those existing commits. Then, you can migrate **Worker** module to use Azure Blob Storage and Azure Service Bus as well, using the created custom formulas.

1. Open the sidebar of `App Modernization for Java`. Hover the mouse over the **Formulas** section. Select **Create formula from source control**. This icon looks like two circles with arrows pointing to the other circle.

![Create Formula From Source Control](doc-media/create-formula-from-source-control.png)

1. Type **migrate web** to search for the commits that migrated the **Web** module, and you should see two commits listed:
* migrate web RabbitMQ to azure service bus
* migrate web s3 to azure blob storage

![Migration Commits](doc-media/migration-commits.png)

1. You will create two custom formulas based on the two commits. First, create the formula for migrating RabbitMQ. Select the commit of **migrate web RabbitMQ to azure service bus**, click OK.
1. Click **Create New** to create a new custom formula.
1. Default formula name will be generated. Give it a new name: "custom formula migrate RabbitMQ". Press `Enter` to confirm. Then, formula description, and search patterns will be generated in order. Press `Enter` repeatedly to confirm.
1. Now, the custom formula for migrating RabbitMQ is generated and shows in the section of formulas in of `App Modernization for Java` blade.

![Custom Formula of Migrating Rabbitmq](doc-media/custom-formula-RabbitMQ.png)

1. Create another custom formula for migrating S3. Follow the same steps you just did, select the commit **migrate web s3 to azure blob storage** to create a new custom formula with name: "custom formula migrate s3".
1. Now, the two custom formulas are ready.

![Custom Formulas](doc-media/custom-formulas.png)

1. Select and run the two custom formulas one by one you created in the formulas section of `App Modernization for Java`, one at a time.

![Run Formula](doc-media/run-formula.png)

1. Follow the same steps as the predefined formula to review and apply the changes, and run the Java Application Build-Fix tool to apply build fixes.
1. Review the proposed code changes and click **Keep** to apply them.

Expand Down