Microsoft Workloads on AWS

How to upgrade and modernize Microsoft Windows Server 2012 with Windows containers on AWS

This blog post is the third in a four-part series on how to upgrade Windows Server 2012 and 2012 R2. The focus of this series is to provide options to handle the upcoming end-of-support event in October. Part 1 overviews the end-of-support dilemma, plus how to perform an in-place, manual upgrade along with an insight into the End of Support Migration Program (EMP). Part 2 walks you through how to automate your upgrade using Amazon Systems Manager (SSM). Part 3 shows how to leverage modernization options, such as AWS App2Container, to handle an upgrade. Part 4 demonstrates how to upgrade Microsoft Windows Server 2012 using the AWS Application Migration Service.

Introduction
Welcome to part 3 in our Navigating Windows Server end-of-support (EOS) series. We’ll walk through the modernization options for EOS using Windows containers, and in situations where an upgrade is not workable, we will show you how the End-of-Support Migration Program (EMP) can help package existing applications running on an EOS operating system (OS) to a new version of the OS on AWS.

Let’s dive in!

Replatform legacy ASP .NET web applications to Windows containers
As we help navigate EOS (as seen in Figure 1) issues with our customers, we are seeing opportunities to use Windows containers to make managing legacy and monolithic applications easier. For ASP .NET web applications, Windows containers are the best way to run them. Containers are naturally portable, scalable, and reliable. By running ASP .NET web applications on Windows containers, you will no longer need to worry about rearchitecting or refactoring their source code. Besides addressing EOS Windows OSes, you can begin (or continue) modernizing your applications by replatforming to Windows containers.

A flow chart diagram showing the various migration and modernization approaches for a .NET web application.

Figure 1. Migration and modernization approaches: Rehost, Replatform, Refactor

Modernizing .NET Framework applications with App2Container

Prerequisites
For more information on these prerequisites, check the documentation here.

  1. Determine if your application has any underlying OS dependencies or Windows APIs (for example, COM interop) that would prevent the application from moving to a new OS.
  2. Set a target Windows OS based on your organizational requirements:
  3. Ensure that your application is supported by App2Container (A2C).
  4. Determine which orchestration platform you would like to use. Amazon ECS and Amazon EKS are the supported platforms for Windows containers and App2Container artifact creation.
  5. Follow the steps to set up a remote worker machine that runs your destination OS version (Windows Server 2019 or 2022) and extracts application artifacts from your source 2012 application server.

You can find step-by-step instructions in the Modernize with AWS App2Container Workshop. The outcome, as seen in Figure 2, the .NET web application modernized in AWS.

A diagram displaying how a .NET modernized web application is hosted on the AWS Cloud.

Figure 2. Example of .NET modernization to AWS

  1. Discover and analyze your application.
    • Run the App2Container analysis that records all Internet Information Server (IIS) websites and Windows services (Windows) that are running on the application server.
    • Review the analysis output file and, if necessary, adjust the container base image to be the desired destination OS. (For example, mcr.microsoft.com/dotnet/framework/runtime:4.8-windowsservercore-ltsc2022 – .NET Framework 4.8 Windows Server core 2022 image). This should automatically be set for you based on the analysis of your IIS and OS configuration.
  2. Extract and containerize your application.
    • On your remote worker machine, run the extract command to generate an application archive for the specified application. This archive will then be available to either copy to your worker machine or specify your Amazon S3 prefix.
    • Run the containerize command to create your DockerFile.
  3. Deploy your containerized application.
    • Adjust your deployment settings to include Amazon ECS or Amazon EKS artifacts. Then run your application deployment to push your container image to Amazon Elastic Container Registry (Amazon ECR) and deploy your application to Amazon ECS or Amazon EKS.
    • Once your application is successfully containerized and secured for public access, you are now ready to plan your production deployment. App2Container supports creating continuous integration and continuous delivery (CI/CD) pipelines for ease of application deployment. App2Container supports several CI/CD tools, including CodePipeline, Jenkins, and Microsoft Azure DevOps. To see a step-by-step deployment of a CI/CD pipeline using App2Container, please refer to the Generating CI/CD Pipelines for Containerized ASP.NET Applications using AWS App2Container blog post.
  4. Push to production.
    • Plan your public URL cutover from your legacy application running on Windows Server 2012 to your new load balancer that frontends your containerized application deployment.
    • If your application has no OS dependencies, then upgrades to future OS versions will be as straightforward as deploying a new build server using the latest Windows OS, changing the FROM line in your apps DockerFile (as seen in Figure 3), building a new container image (as seen in Figure 4), and doing a rolling update.

Note: Appropriate testing to ensure there are no dramatic changes to the underlying OS are needed before implementing in production.

EOS OS:

A command that shows EOS OS Container Base image in DockerFile

Figure 3. EOS OS container base image

New OS:

Figure 4. New OS Container base image in DockerFile

To help better understand the step-by-step process of using App2Container, refer to the App2Container public documentation. If you want to dive deeper into a use case that also migrates your database to Amazon Relational Database Service (Amazon RDS) for SQL Server, please refer to the Modernize with AWS App2Container Workshop.

Refactor – .NET Framework to modern version of .NET
If your organization is ready to refactor its .NET Framework code to a modern version of .NET, you can leverage the Porting Assistant for .NET and AWS Toolkit for .NET Refactoring. By moving to .NET 6+, you unlock the ability to run your .NET code in Linux containers.

Cleanup
Since this blog is a how-to, you won’t need to perform any cleanup steps. The step-by-step approach shows you exactly how to proceed with the upgrade.

Summary
In this blog post, we guided our readers on how to upgrade and modernize their .NET web application by leveraging AWS App2Container. In the next blog post in this blog series, we are going to review how to use AWS Application Migration Service to upgrade a Windows OS.

Please keep in mind that this four-part blog series has discussed and presented many options for dealing with EOS and how AWS can help you address these issues with the use of technology, tooling, and experts.

If you would like help upgrading, please reach out to AWS to address your specific EOS situation and/or needs.


AWS can help you assess how your company can get the most out of cloud. Join the millions of AWS customers that trust us to migrate and modernize their most important applications in the cloud. To learn more on modernizing Windows Server or SQL Server, visit Windows on AWSContact us to start your migration journey today.

Mike Adams

Mike Adams

Mike Adams is a worldwide go-to-market specialist with AWS. His focus is migrating Microsoft workloads to AWS and showing customers how they can achieve operational and cost efficiencies. Prior to AWS, Mike held product marketing roles at Ivanti, VMware, Symantec, and VERITAS Software. Mike started his career as an industry analyst at the Giga Information Group (now part of Forrester Research).

Bill Pfeiffer

Bill Pfeiffer

Bill Pfeiffer is a Sr. Solutions Architect at Amazon Web Services. Bill is focused on helping customers design, implement, and evolve secure and cost optimized infrastructure. Bill is passionate about helping customers solve business challenges with technical solutions. Outside of work, Bill enjoys traveling the US with his family in their RV and competing in ultra running events.

Gianpaolo Albanese

Gianpaolo Albanese

GianPaolo Albanese is a Microsoft Specialist Solutions Architect with Amazon Web Services based in the New York area. GP is focused on helping customers with their Windows architectures, migrations and optimization to the AWS cloud. GP has been an IT professional with over three decades of experience in the FinTech industry, specialized in the management of large-scale infrastructures, migrations and modernization activities. In the past two years, GP has focused his energy to help customers address End-of-Support challenges.