Skip to content

Commit d5ad11b

Browse files
author
Thomas Moore
authored
Merge pull request #70 from aws-samples/tool-guides
Tool guides
2 parents 1e0a4fe + 423c511 commit d5ad11b

40 files changed

+954
-0
lines changed

SampleApplications/2022/MediaCatalog/CloudFormation/mediacatalog.yml

+442
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Setting up your environment
2+
3+
In order to follow this guide, you will need to have a development environment. The environment must have at a minimum:
4+
5+
* A Microsoft Windows 10 or 11 laptop, desktop, EC2 Instance or Virtual Machine.
6+
* [Microsoft Visual Studio 2022 Community, or better.](https://visualstudio.microsoft.com/)
7+
* [Git source control.](https://git-scm.com/)
8+
* Administrative access to Windows.
9+
* [An AWS Account.](https://aws.amazon.com/free)
10+
* [IAM Credentials into your account.](https://us-east-1.console.aws.amazon.com/iamv2/home#/home)
11+
* [AWS Command Line Interface installed.](https://aws.amazon.com/cli/)
12+
13+
This guide assumes that in addition to having Windows set up, you have already installed the tools listed above, and that you have configured access to your AWS Account for the command line. If you have not already done so, please complete the installation and configuration before proceeding.
14+
15+
16+
[Next](./02-Sample-Application.md) <br/>
17+
[Back to Start](../README.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Sample Application
2+
3+
Throughout this guide, we will be refactoring a sample application. This application is available in the AWS .NET Samples GitHub repository.
4+
5+
Download the code [here](https://github.com/aws-samples/aws-net-guides).
6+
7+
At a command line, using your git client type:
8+
9+
```
10+
git clone [email protected]:aws-samples/aws-net-guides.git
11+
```
12+
13+
The sample application that we will use is in the sub folder:
14+
15+
```
16+
SampleApplications\2022\MediaCatalog\MediaLibrary4.8
17+
```
18+
19+
The sample application has a required set of infrastructure that must be deployed into your account. The infrastructure is deployed using Cloud Formation. From the AWS Console, you can create a new CloudFormation stack and use the template located in the sample application.
20+
```
21+
aws-net-guides\SampleApplications\2022\MediaCatalog\CloudFormation\mediacatalog.yml
22+
```
23+
24+
You can also deploy the stack from the AWS Command line using the following command in the aws-net-guides\SampleApplications\2022\MediaCatalog\CloudFormation\ folder.
25+
```
26+
aws cloudformation deploy --template-file MediaCatalog.yml --stack-name MediaCatalogStack --capabilities CAPABILITY_IAM
27+
```
28+
29+
You should make a copy of the Sample Application code, as the actions in this guide will be destructive to the project and source code. For example copy the folder "SampleApplications\2022\MediaCatalog\MediaLibrary4.8" to "C:\Source\MediaLibrary4.8" as this will allow us to change the application source files, while still having the original source code available.
30+
31+
The rest of this guide will assume that your sample project is stored in "C:\Source\MediaLibrary4.8\".
32+
33+
[Next](./03-Sample-Tour.md) <br/>
34+
[Back to Start](../README.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# A Tour of the Sample Application
2+
3+
In Visual Studio, open the solution file:
4+
```
5+
C:\Source\MediaLibrary4.8\MediaLibrary\MediaLibrary.sln
6+
```
7+
8+
Once the solution file is open in Visual Studio, run the solution to have a look at the starting point for the sample application.
9+
10+
![Media Catalog](img/home-page.png)
11+
12+
From the main page, click the "Upload" link under the Upload title.
13+
14+
Use the Browse and Upload buttons to upload an image to the application.
15+
16+
![Upload](img/upload.png)
17+
18+
In the sample code folder, there are sample images provided by the Smithsonian Institution. These images can be found by going to the origional location that you cloned the repo and looking in the following folder structure.
19+
```
20+
aws-net-guides\SampleApplications\2022\MediaCatalog\MediaLibrary6.0\SampleImages\
21+
```
22+
23+
Browse to this folder and select the image "NZP-20140817-6602RG-000003.jpg" click "Upload File" once the file has been selected.
24+
25+
The upload process automatically uses Amazon Rekognition to scan the image for any content that might be offensive. The application code automatically rejects any image where any moderation flags have been found.
26+
27+
Once uploaded, the application will bring you to a list of the files that have been uploaded, and are ready to process.
28+
29+
![Process](img/process.png)
30+
31+
Click the "Process" link beside the image. This will use Amazon Rekognition to scan the image and find labels for things that are in the image.
32+
33+
The processing page will give you a list of all the labels that Rekognition has detected and give you an opportunity to save the labels that you want against the image.
34+
35+
![Rekognition Results](img/results.png)
36+
37+
Select the options for Cheetah, Wildlife, Animal and Mammal. Then click Save.
38+
39+
You will then be brought back to the image list view. The image will no longer have a "Process" link, but will not have a link that allows you to view the previously saved results.
40+
41+
![Final](img/final.png)
42+
43+
This completes the tour of the Media Catalog application. Feel free to spend more time looking around the application and becoming familiar with the other functions that are available before moving on to the next part of the guide.
44+
45+
46+
[Next](../02-Getting-Started/01-Instalation.md) <br/>
47+
[Back to Start](../README.md)
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Installing the AWS Toolkit for .NET Modernization
2+
3+
The AWS Toolkit for .NET Refactoring installs in Visual Studio as an extension. If you don't have Visual Studio open, start it now and select the option to continue without code.
4+
5+
![Open VS](img/visual-studio-open.png)
6+
7+
From Visual Studio, click on the Extensions menu item, and then click on Manage Extensions.
8+
9+
![Manage Extensions](img/manage-extenstions.png)
10+
11+
Make sure the option to search for “Online” extensions is selected. Then type “AWS” in the search field. Your extensions list will be filtered down. From this menu you can select the “AWS Toolkit for .NET Refactoring VS 2022” from the menu. Once selected, click the Download button.
12+
13+
![Manage Extensions](img/download-toolkit.png)
14+
15+
Once the download has been completed, you will receive a message that the changes will be scheduled once Visual Studio is closed. At this point, click the Close button, and shut down Visual Studio.
16+
17+
![Close Visual Studio](img/close-visual-studio.png)
18+
19+
Click the Close button, then close Visual Studio. Once Visual Studio closes, the Visual Studio Extension Installer application will run.
20+
21+
![Close Visual Studio](img/modify-visual-studio.png)
22+
23+
Click the Modify button to allow Visual Studio to install the extension.
24+
25+
This completes the installation of the .NET Refactoring Toolkit for .NET.
26+
27+
28+
[Next](./02-assessing-application.md) <br/>
29+
[Back to Start](../README.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# Assessing your application
2+
3+
The first step in using the AWS Toolkit for .NET Refactoring to refactor your application from .NET Framework 4.8 to .NET 6 is to perform an assessment of the current application. This assessment will scan through your application code, dependencies, and NuGet packages to help determine the level of complexity with converting your application.
4+
5+
The assessment is nondestructive, the results of the assessment is a report.
6+
7+
From Visual Studio, open the solution file
8+
9+
```
10+
C:\source\MediaLibrary4.8\MediaLibrary\MediaLibrary.sln
11+
```
12+
13+
If the toolkit does not automatically open the Getting Started page below, you can manually launch the Getting Started page by clicking on the extensions menu, select the AWS Toolkit for .NET Refactoring, and then clicking on Getting Started.
14+
15+
![Configure Toolkit Menu](img/toolkit-configure-menu.png)
16+
17+
## Configuring the Toolkit
18+
19+
The AWS Toolkit will need to be configured on the first execution. The configuration page is seen here:
20+
21+
![Configure Toolkit Menu](img/toolkit-configure.png)
22+
23+
In order to progress beyond the first page, you must click on the link under the End User License Agreement (EULA.) Click on this link and read the agreement on the linked page.
24+
25+
The first configuration option is to select how the toolkit will connect to AWS. You have two options for these details. First, you can specify a named profile that has been configured by the AWS Command Line. In this case you have an access key and a secret key configured on your machine. Typically, these credentials are stored by using the command:
26+
```
27+
aws configure
28+
```
29+
And then providing credentials.
30+
31+
The second option is to allow the tool to locate credentials automatically. This option will allow the tool to use credentials that were obtained via IAM Identity Center (Formerly SSO) or inherit credentials from an IAM Role attached to an EC2 Instance.
32+
33+
Functionality for the application will be identical with either method, as long as the selected method has valid credentials for your AWS account. If you are unsure of which option to use, consult with your AWS Account Administrator as they may have policies that determine which method is to be used for obtaining AWS Credentials.
34+
35+
The second configuration option that needs to be set is the region for test deployments. Currently, you can select either "US-EAST-2" or "EU-WEST-2." Note that this selection applies **only** to the test deployments conducted by the toolkit. You have the option to deploy your applications to any AWS region once you are happy with the refactoring.
36+
37+
Once these options have been completed, click Next.
38+
39+
## Starting the Assessment
40+
41+
After configuring the toolkit, you are presented with the Refactoring Dashboard.
42+
43+
![Dashboard - Not Started](img/dashboard-not-started.png)
44+
45+
At this point, the Assessment is listed as "Not Started." As a result other toolkit functionality may not be available. In order to perform an assessment, you first need to open one of the code files in the solution. Double click on the "HomeController.cs" file to open it, then click back on the Dashboard Window.
46+
47+
![Dashboard - Not Started](img/open-code-file.png)
48+
49+
From this window select the option to "Start Assessment" and the toolkit will begin inspecting your application.
50+
51+
![Dashboard - Not Started](img/assessment-in-progress.png)
52+
53+
The status on the dashboard will change to "In Progress" while the scanning takes place.
54+
55+
![Dashboard - Not Started](img/assessment-complete.png)
56+
57+
Once your assessment is complete, you will receive an assessment report below.
58+
59+
### Incompatible NuGet packages
60+
61+
This lists the number of packages that are included in the solution that are not compatible with the target version of .NET in this case .NET 6. Note that for these packages, you will need to find alternatives for the required functionality.
62+
63+
### Incompatible APIs
64+
65+
This lists the number of API calls that are not portable to the new version of .NET. This may be cases where functionality has been deprecated or the API calls have breaking changes. Manual coding effort will be required, after porting, to make the code compatible with the new target version of .NET.
66+
67+
These results provide details to the amount of manual work, that the toolkit was able to identify, that will be required after the porting. It is important to understand that these are the incompatibilities that the tool was able to identify, it is not necessarily all of the changes that will be required. You may find code that needs to be reworked when you test your application after porting.
68+
69+
Further details of the incomparable code can be found by looking at the error list, and selecting to view Warnings. Each item in the list shows some manual effort that you will have to complete.
70+
71+
![Dashboard - Not Started](img/error-list.png)
72+
73+
74+
[Next](../03-porting-application/01-porting-application.md) <br/>
75+
[Back to Start](../README.md)
76+
77+
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Porting your application
2+
Once your assessment has been completed, you are able to port your project to the desired version of .NET.
3+
4+
## Warning:
5+
Porting application code is destructive. You can't undo the changes once the process of porting your solution has begun. Backup all source code before progressing.
6+
7+
## Start porting your application
8+
9+
You start the porting process for your application from the assessment dashboard. Select the project to be ported in the Solution Explorer, then click the Port drop down, and click "Port Selected Project."
10+
11+
![Start Assessment](img/start-porting.png)
12+
13+
At this point you receive one final warning that the process is permanent.
14+
15+
![Warning](img/confirm-porting.png)
16+
17+
Check the confirmation and then click the Port button. The time required for porting your application will vary depending on the size of the solution, number of projects, etc. This sample project completes quickly. Once porting has been completed, you will receive a message showing that porting has been successful.
18+
19+
![Porting Complete](img/porting-complete.png)
20+
21+
Click Ok to dismiss this dialog. You will then receive a message that your project files have been updated. This dialog will give you the option to reload. You should click the button to "Reload All" before going any further.
22+
23+
![Reload Projects](img/reload-projects.png)
24+
25+
Once your project has been reloaded, the dashboard will look like this.
26+
27+
![Porting Results](img/refactoring-results.png)
28+
29+
This completes the porting of your application. However, if you attempt to run the application now, the application will not compile. You will need to move onto the manual refactoring stage in order to complete the move to .NET 6.
30+
31+
32+
[Next](./02-manual-refactoring.md) <br/>
33+
[Back to Start](../README.md)

0 commit comments

Comments
 (0)