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.
Modernizing .NET Framework applications with App2Container
Prerequisites
For more information on these prerequisites, check the documentation here.
- 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.
- Set a target Windows OS based on your organizational requirements:
- NOTE: Amazon Elastic Container Service (Amazon ECS) and Amazon Elastic Kubernetes Service (Amazon EKS) are the two supported orchestration platforms for running Windows cContainers. We recommend you upgrade to Windows Server 2022, but common compute options support Windows Server 2019 and 2022. Windows Server 2016 is only supported on the ECS Amazon Elastic Compute Cloud (Amazon EC2) launch type.
- Ensure that your application is supported by App2Container (A2C).
- 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.
- Optionally, you can set up an Amazon Simple Storage Service (Amazon S3) bucket and test environment where your application is fully functional so you can target the application with the App2Container CLI tools. Otherwise, your application artifacts will be stored locally on the server running App2Container.
- 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.
- 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.
- 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.
- 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.
- 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:
New OS:
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.
- Part 1: How to manually upgrade Microsoft Windows Server 2012 on AWS
- Part 2: How to automate your Microsoft Windows Server upgrades using AWS Systems Manager
- Part 4: How to upgrade Microsoft Windows Server 2012 with AWS Application Migration Service
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 AWS. Contact us to start your migration journey today.