In this module, you will be transforming your application with app2container. The transform phase activities depends on whether you are running all steps on the application server, or are using the application server for the analysis and a worker machine for containerization and deployment. In this scenario ( Containerize your .NET app), you will be running all below steps on the Worker Machine.
Separating the containerization environment using a worker machine is a best practice and provides you security and functional benefits and allows you to standardize your containerization process to help your larger scale containerization efforts.
app2container remote extract --target <private-IP of your source server> --application-id <net-app-id>
At this point, you can also update the artifacts inside the zip file and continue the containerization with the updated zip file.
You can copy the suggested command from the CLI output.
app2container containerize --input-archive C:\Users\Administrator\AppData\Local\app2container\remote\<PrivateIPAddress>\<net-app-id>\<net-app-id>.zip
The process will take few mins, as Worker machine will need download the Windows 2019 base image for your container. Once process finished, you should see the below output.
Notice that, you’ve updated your operating system at this step. This could be especially useful where your applications are running on EOL(End Of Life) OS versions.
4. Open the file and review the configurations.
Ensure “createEcsArtifacts” is set to “true”.
Enter your Target vpc-id to deploy your application into your target network.
Go to AWS console and Navigate to VPC Service.
In your VPCs, find “TargetVPC” and copy the vpc-id as shown below.
In deployment.json file, Find “reuseResources” part and paste your copied for “vpcId” value. As show on the above example.
If you don’t update your VPC-ID in deployment.json file, app2container will deploy your application into the Default VPC.
Congratulations! You have defined all your target AWS configuration settings and ready to deploy your application.
In the next section you will create deployment artifacts for your deployment.