Skip to Content
Cloud Engineering Academy
13. Microsoft-to-AWS Migration

.NET Framework to modern .NET

Move a .NET Framework 4.8 banking application to .NET 10: find the blockers with a scanner, choose between AWS Transform for .NET, Microsoft tooling and a strangler approach, fix WCF, Web Forms and Windows-only code, containerise on Linux, and decide honestly when staying on Windows is right.

advanced⏱ 3 h 🟢 FreeSAP-C03SAA-C03

Assumes: .NET Framework 4.8 → .NET 10 LTS · AWS Transform for .NET · Microsoft.Data.SqlClient · EF Core 10 · AWS CDK v2 (C#) · Terraform AWS provider v6 · Region us-east-1. Verified against official sources on 2026-11-18.

Learning objectives

By the end of this lesson you can:

  • Decide, per application, between stay on Windows, port to .NET 10 on Linux, and strangle gradually, using blockers, cost and risk.
  • Run a blocker scan over a .NET Framework codebase and turn the result into a prioritised porting backlog.
  • Explain what AWS Transform for .NET and Microsoft's upgrade tooling do and what they leave to you.
  • Fix the common blockers: System.Web, web.config, Entity Framework 6, System.Data.SqlClient, WCF, Web Forms and Windows-only APIs.
  • Containerise the result for Linux (and know when a Windows container is the right fallback) and deploy it to ECS on Fargate with C# CDK or Terraform.

Prerequisites

Why this matters in banking

Harbourline's Branch Portal is a 2013 ASP.NET MVC 5 and Web Forms application on .NET Framework 4.8, with a WCF service that three other systems call, Windows authentication against Active Directory, Entity Framework 6 and a few System.Drawing calls that render cheque images. It works, it is audited, and it runs on four Windows Server VMs with licences that cost more than the compute.

Rehosting would move it in a month. Porting it to .NET 10 on Linux removes the Windows licence line and opens containers, but it touches a payments-adjacent code path and needs regression evidence. Leaving it for "later" has a price too: the Framework 4.8 component itself continues to be supported with Windows, but the ecosystem (new libraries, security tooling, AWS SDK generations) moves on to modern .NET. Each year of delay makes the port larger. The decision should be made deliberately, with data.

The idea in plain language

".NET Framework" and ".NET" (the modern one, currently .NET 10 LTS) are two different runtimes. Framework is Windows-only and in maintenance. Modern .NET is cross-platform and where all new work happens. Porting is mostly replacing the pieces that only exist on Framework with modern equivalents, then recompiling:

LayerFrameworkModern .NET
Web stackSystem.Web (ASP.NET MVC 5, Web API 2, Web Forms)ASP.NET Core
Service contractsWCF (server)CoreWCF, gRPC or REST
Data accessEntity Framework 6, System.Data.SqlClientEF Core, Microsoft.Data.SqlClient
Configweb.config, ConfigurationManagerappsettings.json, options pattern, Secrets Manager
IdentityWindows auth, Forms authOIDC, JWT, Cognito or Identity Center
HostingIISKestrel in a container

Tools do the mechanical part (project files, namespaces, package versions, many API swaps). A person does the architectural part (sessions, authentication, WCF contracts, transactions) and, crucially, proves behavioural equivalence.

Analogy: Converting a petrol delivery van to electric. A conversion kit swaps the engine mount and wiring (mechanical, automatable), but someone still has to recalibrate the brakes and re-test the vehicle before it goes back on the road (behavioural, human).

What problem the AWS tooling solves

ToolWhat it doesStatus and limits (checked 2026-11-18)
AWS Transform for .NETAn AI-assisted service that analyses .NET Framework solutions and transforms code to cross-platform .NET; works through AWS Transform's web application or Visual Studio integration; produces a transformed branch and a report for reviewGA since May 2025. Supported project types, target versions and pricing change; confirm the .NET 10 target and current costs ⚠ VERIFY. Output must be reviewed and tested
Porting Assistant for .NET, App2Container, Microservice Extractor, Toolkit for .NET RefactoringOlder AWS .NET modernisation toolsClosed to new customers on 2025-11-07. Do not start new work on them
.NET Upgrade Assistant (Microsoft)CLI and Visual Studio tool that upgrades project files and packagesMicrosoft has been steering users toward a Copilot-based modernisation agent; the older tool is no longer developed ⚠ VERIFY current status
Microsoft System.Web adaptersLibrary that lets you migrate incrementally, sharing session and authentication between an old and a new appUseful for strangler migrations ⚠ VERIFY the supported scenarios and versions
CoreWCFOpen-source WCF server for ASP.NET CoreSupports common bindings; check yours ⚠ VERIFY

None of these tools can tell you whether the ported application behaves the same. That is your test suite and your reconciliation evidence.

Microsoft / Azure comparison

You know (Microsoft/Azure)AWS equivalentWhat's different
IIS or Azure App Service (Windows)ECS Fargate (Linux container), Elastic Beanstalk (Windows or Linux), ECS Express ModeLinux is cheaper (no Windows licence). Beanstalk keeps IIS if you must
App Service "Always On", slotsECS rolling or blue/green deploys, ALB health checksSlot swaps become weighted target groups
Azure App Service Windows authenticationNone built in; use OIDC (Entra ID via Identity Center or Cognito federation)Kerberos in containers is possible but heavy; redesign if you can
Azure Migrate app-modernisation assessmentsAWS Transform for .NET assessmentBoth produce a compatibility report
Azure Functions in-process on FrameworkLambda with the dotnet10 managed runtimeCold-start and packaging differ (Lambda with C#)
Azure Container AppsECS Express Mode or FargateExpress Mode is the simple path; App Runner is closed to new customers
Azure Key Vault configSecrets Manager and Parameter StoreSee Configuration done right

Architecture

Security-boundary view. The ALB terminates TLS and applies WAF rules; both applications run in private subnets and accept traffic only from the ALB security group. In the strangler phase, shared session and authentication are the dangerous seam: two apps trusting one cookie or one cache means a cookie-handling flaw in either exposes both. Use signed, short-lived tokens, and keep the cache in a private subnet with encryption in transit and at rest.

Step-by-step implementation

Triage: stay, port or strangle

Run the blocker scanner (below) on every candidate. Apply this rule of thumb:

SignalLeans toward
Few System.Web, no Web Forms, WCF optional, good testsPort to .NET 10
Large Web Forms estate, heavy third-party Windows controls, no testsStay on Windows (rehost) and plan a strangler or rewrite
Large, valuable, partly modular, can route by URLStrangle with a proxy and the System.Web adapters
Vendor-supported package that only runs on WindowsStay until the vendor ships a modern version

Build a safety net first

Before touching code, add characterisation tests: API-level tests that record current behaviour for key flows (login, balance, payment initiation, statement). Also capture outputs of batch jobs for a fixed input set. These tests run against both the old and new builds.

Convert mechanically

Move to SDK-style project files, update packages, change TargetFramework to net10.0. Use AWS Transform for .NET where you have access (review the diff like a pull request from a junior developer), or the Microsoft tooling and your IDE.

Replace the blockers

Work the scanner's backlog by severity: configuration and data access first (because everything depends on them), then the web layer, then the Windows-only code. Examples below.

Prove equivalence

Run the characterisation tests against both versions, compare outputs, and run the data-layer checks (money is decimal in both, rounding mode is the same, time zones and culture settings are explicit). Performance test, because the runtime behaves differently.

Containerise and deploy

Build a Linux image, deploy to a non-production ECS service, run side by side with the old one, then shift traffic gradually (weighted target groups). Keep the old stack until the rollback window ends.

AWS Console instructions

  • AWS Transform: sign in to the AWS Transform web application with IAM Identity Center, create a job for .NET modernisation, connect your repository (the supported sources are listed in the user guide ⚠ VERIFY), and review the generated branch and assessment report.
  • ECR → Create repository (scan on push on, tag immutability on) for the image.
  • ECS → Task definitions → Create (Fargate, Linux/X86_64 or Linux/ARM64), then Clusters → Services → Create behind an ALB. For a simple start choose ECS Express Mode ⚠ VERIFY the console flow, which AWS has been changing.

AWS CLI

# Create an immutable, scanning repository for the ported application.
aws ecr create-repository --repository-name hl/branch-portal \
  --image-tag-mutability IMMUTABLE \
  --image-scanning-configuration scanOnPush=true \
  --profile learn-sandbox --region us-east-1

# Authenticate Docker to ECR (token valid for 12 hours).
aws ecr get-login-password --profile learn-sandbox --region us-east-1 \
  | docker login --username AWS --password-stdin 123456789012.dkr.ecr.us-east-1.amazonaws.com

# Build for Linux and push.
docker build -t 123456789012.dkr.ecr.us-east-1.amazonaws.com/hl/branch-portal:1.0.0 .
docker push 123456789012.dkr.ecr.us-east-1.amazonaws.com/hl/branch-portal:1.0.0

Replace 123456789012 with your account ID.

Infrastructure as Code

The same task definition runs on Linux Fargate for the ported application, and the lesson shows how a Windows fallback differs (only the runtime platform changes, but the cost and image size do).

PortalServiceStack.cs
using Amazon.CDK;
using Amazon.CDK.AWS.EC2;
using Amazon.CDK.AWS.ECR;
using Amazon.CDK.AWS.ECS;
using Amazon.CDK.AWS.ECS.Patterns;
using Amazon.CDK.AWS.Logs;
using Constructs;

namespace Harbourline.Migration.Infra;

public sealed class PortalServiceStack : Stack
{
    public PortalServiceStack(Construct scope, string id, IStackProps? props = null)
        : base(scope, id, props)
    {
        var vpc = new Vpc(this, "Vpc", new VpcProps { MaxAzs = 2, NatGateways = 1 });
        var cluster = new Cluster(this, "Cluster", new ClusterProps { Vpc = vpc, ContainerInsightsV2 = ContainerInsights.ENABLED });

        var repo = Repository.FromRepositoryName(this, "Repo", "hl/branch-portal");

        var service = new ApplicationLoadBalancedFargateService(this, "Portal", new ApplicationLoadBalancedFargateServiceProps
        {
            Cluster = cluster,
            Cpu = 512,
            MemoryLimitMiB = 1024,
            DesiredCount = 2,
            // Linux, ARM64 is the cheapest option if your dependencies support it. Use X86_64 otherwise.
            RuntimePlatform = new RuntimePlatform
            {
                OperatingSystemFamily = OperatingSystemFamily.LINUX,
                CpuArchitecture = CpuArchitecture.ARM64
            },
            TaskImageOptions = new ApplicationLoadBalancedTaskImageOptions
            {
                Image = ContainerImage.FromEcrRepository(repo, "1.0.0"),
                ContainerPort = 8080,
                LogDriver = LogDrivers.AwsLogs(new AwsLogDriverProps
                {
                    StreamPrefix = "portal",
                    LogRetention = RetentionDays.ONE_MONTH
                }),
                Environment = new Dictionary<string, string>
                {
                    ["ASPNETCORE_URLS"] = "http://+:8080"
                }
            },
            PublicLoadBalancer = true // ⚠ learning shortcut: use an internal ALB behind CloudFront or WAF in production
        });

        service.TargetGroup.ConfigureHealthCheck(new Amazon.CDK.AWS.ElasticLoadBalancingV2.HealthCheck
        {
            Path = "/healthz"
        });

        // A Windows fallback changes only the platform and image: OperatingSystemFamily.WINDOWS_SERVER_2022_CORE
        // with CpuArchitecture.X86_64 and a Windows base image ⚠ VERIFY current Windows-on-Fargate support and sizes.

        Amazon.CDK.Tags.Of(this).Add("Project", "cea-lab");
        Amazon.CDK.Tags.Of(this).Add("Lab", "m13-port");
        Amazon.CDK.Tags.Of(this).Add("Environment", "learn");
        Amazon.CDK.Tags.Of(this).Add("Owner", "your-name");
    }
}

Complete code

The blocker scanner

A console tool that scans a .NET Framework solution folder and prints a ranked porting backlog. It uses only the base class library.

Program.cs
using System.Text.RegularExpressions;

if (args.Length != 1 || !Directory.Exists(args[0]))
{
    Console.Error.WriteLine("usage: dotnet run -- <path-to-solution-folder>");
    return 1;
}

var root = Path.GetFullPath(args[0]);
var skipDirs = new HashSet<string>(StringComparer.OrdinalIgnoreCase) { "bin", "obj", "packages", "node_modules", ".git", ".vs" };
var results = new Dictionary<string, List<string>>();

foreach (var file in Walk(root, skipDirs))
{
    var ext = Path.GetExtension(file).ToLowerInvariant();
    if (ext is not (".cs" or ".csproj" or ".config" or ".aspx" or ".ascx" or ".svc" or ".asmx" or ".cshtml" or ".master")) continue;

    string text;
    try { text = File.ReadAllText(file); }
    catch (IOException) { continue; }       // locked file: skip, do not crash the scan
    catch (UnauthorizedAccessException) { continue; }

    foreach (var rule in Rules.All)
    {
        if (rule.Extensions.Length > 0 && !rule.Extensions.Contains(ext)) continue;
        var count = rule.Pattern.Matches(text).Count;
        if (count == 0) continue;
        if (!results.TryGetValue(rule.Name, out var list)) results[rule.Name] = list = [];
        list.Add($"{Path.GetRelativePath(root, file)} ({count})");
    }
}

Console.WriteLine($"Scanned: {root}\n");
foreach (var rule in Rules.All.OrderBy(r => r.Severity).ThenBy(r => r.Name, StringComparer.Ordinal))
{
    if (!results.TryGetValue(rule.Name, out var hits)) continue;
    Console.WriteLine($"[{rule.Severity}] {rule.Name}: {hits.Count} file(s)");
    Console.WriteLine($"    fix: {rule.Fix}");
    foreach (var h in hits.Take(5)) Console.WriteLine($"    - {h}");
    if (hits.Count > 5) Console.WriteLine($"    ... and {hits.Count - 5} more");
}

var blockers = results.Keys.Count(k => Rules.All.First(r => r.Name == k).Severity == Severity.Blocker);
Console.WriteLine($"\nBlocker categories found: {blockers}");
return blockers == 0 ? 0 : 3;

static IEnumerable<string> Walk(string dir, HashSet<string> skip)
{
    foreach (var f in Directory.EnumerateFiles(dir)) yield return f;
    foreach (var d in Directory.EnumerateDirectories(dir))
    {
        if (skip.Contains(Path.GetFileName(d))) continue;
        foreach (var f in Walk(d, skip)) yield return f;
    }
}

enum Severity { Blocker = 0, Major = 1, Minor = 2 }

sealed record Rule(string Name, Severity Severity, Regex Pattern, string[] Extensions, string Fix);

static class Rules
{
    private static Regex R(string p) => new(p, RegexOptions.Compiled | RegexOptions.CultureInvariant);

    public static readonly Rule[] All =
    [
        new("System.Web (MVC 5, Web API 2, Web Forms)", Severity.Blocker,
            R(@"using\s+System\.Web\b|System\.Web\.Mvc|HttpContext\.Current"), [".cs", ".cshtml"],
            "Port to ASP.NET Core; inject IHttpContextAccessor instead of HttpContext.Current"),
        new("Web Forms pages and controls", Severity.Blocker,
            R(@"<%@\s*Page|runat\s*=\s*""server"""), [".aspx", ".ascx", ".master"],
            "No direct port: rewrite as Razor Pages or an SPA, or keep on Windows"),
        new("WCF service host", Severity.Blocker,
            R(@"\[ServiceContract\]|ServiceHost\b|<system\.serviceModel"), [".cs", ".config", ".svc"],
            "CoreWCF to keep the contract, or gRPC/REST to redesign"),
        new("ConfigurationManager / web.config", Severity.Major,
            R(@"ConfigurationManager\.(AppSettings|ConnectionStrings)"), [".cs"],
            "IConfiguration and the options pattern; secrets to Secrets Manager"),
        new("Entity Framework 6", Severity.Major,
            R(@"using\s+System\.Data\.Entity|DbContext\s*:\s*DbContext|EntityFramework"), [".cs", ".csproj", ".config"],
            "EF Core 10; review lazy loading, migrations and raw SQL"),
        new("System.Data.SqlClient", Severity.Major,
            R(@"System\.Data\.SqlClient"), [".cs", ".csproj", ".config"],
            "Microsoft.Data.SqlClient (check Encrypt defaults: they are stricter)"),
        new("Windows authentication / identity", Severity.Major,
            R(@"WindowsIdentity|User\.Identity\.Name|windowsAuthentication"), [".cs", ".config"],
            "OIDC/JWT; plan a Kerberos strategy only if unavoidable"),
        new("Windows-only APIs (registry, event log, System.Drawing)", Severity.Major,
            R(@"Microsoft\.Win32\.Registry|EventLog\b|System\.Drawing\b|System\.Management\b"), [".cs"],
            "Cross-platform libraries (SkiaSharp, ImageSharp), CloudWatch Logs, configuration"),
        new("Removed or unsafe APIs", Severity.Major,
            R(@"BinaryFormatter|AppDomain\.CreateDomain|Thread\.Abort|System\.Messaging"), [".cs"],
            "System.Text.Json, separate processes, CancellationToken, SQS instead of MSMQ"),
        new("Session state and machine keys", Severity.Minor,
            R(@"Session\[|<machineKey|<sessionState"), [".cs", ".config", ".cshtml"],
            "Distributed cache (ElastiCache) or stateless tokens; protect data-protection keys"),
        new("Old-style project (no SDK attribute)", Severity.Minor,
            R(@"<Project\s+ToolsVersion"), [".csproj"],
            "SDK-style project file; mechanical, tools do it")
    ];
}

The Dockerfile for the ported result

Dockerfile
# Build stage: full SDK, restores and publishes.
FROM mcr.microsoft.com/dotnet/sdk:10.0 AS build
WORKDIR /src
COPY . .
RUN dotnet publish Harbourline.BranchPortal/Harbourline.BranchPortal.csproj \
    -c Release -o /app/publish /p:UseAppHost=false

# Runtime stage: small image, non-root user.
FROM mcr.microsoft.com/dotnet/aspnet:10.0 AS runtime
WORKDIR /app
COPY --from=build /app/publish .
ENV ASPNETCORE_URLS=http://+:8080
EXPOSE 8080
USER $APP_UID
ENTRYPOINT ["dotnet", "Harbourline.BranchPortal.dll"]

Two common replacements

AccountRepository.cs
using Microsoft.Data.SqlClient;
using Microsoft.Extensions.Options;

namespace Harbourline.BranchPortal;

public sealed class LedgerOptions
{
    public const string Section = "Ledger";
    public string ConnectionString { get; set; } = "";
}

public sealed class AccountRepository(IOptions<LedgerOptions> options)
{
    private readonly string _connectionString = options.Value.ConnectionString;

    public async Task<decimal?> GetBalanceAsync(string accountId, CancellationToken ct)
    {
        await using var conn = new SqlConnection(_connectionString);
        await conn.OpenAsync(ct);

        await using var cmd = new SqlCommand(
            "SELECT balance FROM dbo.accounts WHERE account_id = @id", conn);
        cmd.Parameters.Add("@id", System.Data.SqlDbType.VarChar, 14).Value = accountId;

        var result = await cmd.ExecuteScalarAsync(ct);
        return result is decimal d ? d : null; // money stays decimal, never double
    }
}
Program.cs
using Harbourline.BranchPortal;

var builder = WebApplication.CreateBuilder(args);

// web.config appSettings replaced by layered configuration: appsettings.json, environment, then Secrets Manager.
builder.Services.Configure<LedgerOptions>(builder.Configuration.GetSection(LedgerOptions.Section));
builder.Services.AddScoped<AccountRepository>();
builder.Services.AddHealthChecks();

var app = builder.Build();
app.MapHealthChecks("/healthz");
app.MapGet("/accounts/{id}/balance", async (string id, AccountRepository repo, CancellationToken ct) =>
    await repo.GetBalanceAsync(id, ct) is { } balance
        ? Results.Ok(new { accountId = id, balance })
        : Results.NotFound());
app.Run();

Code explained line by line

  1. The scanner's Rules array is the porting policy as data. Adding a rule is one line, and severity drives the report order, so the report reads as a backlog.
  2. RegexOptions.Compiled and CultureInvariant keep the scan fast and independent of the machine's locale.
  3. The catch blocks for IOException and UnauthorizedAccessException skip locked files, so one open file does not abort a scan of a large solution.
  4. The exit code is non-zero when blocker categories are found, so a pipeline can mark a candidate "needs design" automatically.
  5. In the Dockerfile, the two stages keep compilers out of the runtime image. USER $APP_UID uses the non-root user that the .NET 10 images define ⚠ VERIFY the variable name for your image tag. UseAppHost=false avoids an unnecessary native launcher.
  6. AccountRepository uses a primary constructor to receive options, not static ConfigurationManager. The parameter is typed with a length (VarChar, 14), so SQL Server can reuse query plans, and the balance is read as decimal.
  7. The minimal API replaces a Web API 2 controller: Results.Ok and Results.NotFound map to the status codes the old controller returned, which the characterisation tests should assert.

Security considerations

⚠ Learning shortcut — not for production

The ALB above is public and the lesson container reads a connection string from configuration. In production keep the service behind an internal ALB fronted by CloudFront and WAF, read the connection string from Secrets Manager at start-up (or use IAM database authentication where the engine supports it), and run containers with a read-only root filesystem and no extra Linux capabilities.

  • Stricter TLS defaults. Microsoft.Data.SqlClient encrypts connections by default and validates the server certificate. A port that "works on the dev box" may fail against a SQL Server with a self-signed certificate. Fix the certificate; do not set TrustServerCertificate=true in production.
  • Authentication rewrites are security work. Replacing Windows authentication with OIDC changes who can log in and how sessions end. Treat it as a security change with its own review, and plan with the guidance in Federation and segregation of duties.
  • Package supply chain. The port will add dozens of NuGet packages. Pin versions, scan in CI (Pipeline security scanning) and use ECR scan-on-push.
  • Regression evidence. For a payments-adjacent system, a change board needs proof of equal behaviour: the characterisation test output is the proof.

Banking use case

Harbourline's portfolio has three Framework applications. The Branch Portal (Web Forms heavy) is strangled: a YARP-style proxy routes new pages to ASP.NET Core on Fargate while the System.Web adapters share session during the transition. The Statement Service (WCF plus Windows services) is ported using AWS Transform for .NET and CoreWCF to keep its three consumers working, then rebuilt as REST when those consumers migrate. The cheque-imaging tool, which depends on a licensed Windows imaging component, stays on Windows on a Beanstalk Windows environment, with a note on the risk register and a review date. All three decisions are recorded with the scanner output as evidence.

Common mistakes

  • Porting before testing. Without characterisation tests you cannot show equivalence. Write tests first.
  • Trusting tool output. Transform tools produce compiling code, not correct code. Review diffs, run tests, and check money and time handling.
  • Ignoring culture and time zones. Linux containers default to different culture and time-zone data. Set InvariantGlobalization deliberately and use UTC and explicit time zones.
  • Leaving file paths and case sensitivity alone. Linux file systems are case-sensitive and use /. A Windows-path assumption becomes a runtime failure.
  • Lifting EF6 lazy-loading assumptions. EF Core does not lazy-load unless configured; N+1 behaviour and tracking differ.
  • Forgetting the batch jobs. The web app ports; the scheduled tasks and Windows services are forgotten. Scan for them explicitly.

Troubleshooting

SymptomLikely causeFix
Login failed or certificate error after moving to Microsoft.Data.SqlClientDefault encryption now on, certificate untrustedInstall a trusted certificate or add the CA to the container trust store
Container exits immediatelyApp binds to localhost or wrong portSet ASPNETCORE_URLS=http://+:8080 and match the target-group port
Fonts or images render differentlySystem.Drawing has no Linux backend in modern .NETUse SkiaSharp or ImageSharp and install required fonts in the image
ALB health check fails/healthz not mapped or needs authMap the health endpoint without authentication
A date or sort differs from the old systemCulture or time-zone differenceSet culture explicitly; use TimeProvider and UTC
Scanner reports nothingWrong root path or files with unusual extensionsPoint at the solution folder; extend the extension list

Cost and cleanup

Cost: free. The scanner and the container build run locally. Deploying the IaC to Fargate is a small paid exercise: 2 tasks at 0.5 vCPU and 1 GB, an ALB and a NAT gateway cost roughly USD 3 to 4 per day, with the NAT gateway and ALB the largest parts ⚠ VERIFY current prices. Deploy-and-destroy within an hour for under USD 1, or treat the IaC as a design-only exercise.

# CDK or Terraform users: destroy the stack.
cdk destroy
# terraform destroy

# Delete the ECR repository and its images.
aws ecr delete-repository --repository-name hl/branch-portal --force --profile learn-sandbox --region us-east-1

# Confirm nothing tagged Project=cea-lab remains.
aws resourcegroupstaggingapi get-resources --tag-filters Key=Project,Values=cea-lab --profile learn-sandbox

Exercises

  • 🟢 Guided: Create a folder with two small .cs files, one using HttpContext.Current and ConfigurationManager.AppSettings, one clean. Run the scanner and confirm it ranks System.Web as a blocker.
  • 🟡 Challenge: Add a rule for Thread.Sleep in request handlers and one for static mutable fields that hold per-user state. Explain why the second one matters more in a container than on a single IIS server.
  • 🔴 Live problem: A vendor ships a Windows-only imaging component that the cheque tool needs, and the vendor says a Linux version is "on the roadmap". Management wants the Windows licences gone this year. Write the options paper: keep a small Windows island, containerise on Windows, replace the vendor, or wrap the component behind a service. Include the cost and risk of each.

Assignment

Add a legacy-port-plan.md to your portfolio: scanner output for a sample .NET Framework app (use the open-source bobs-used-bookstore-classic sample from AWS samples, licence MIT-0), a stay/port/strangle decision per component, the characterisation tests you would write first, and a rollback approach.

Solutions

Knowledge check

Interview questions

  • How do you prove a ported application behaves the same? Characterisation tests run against old and new, recorded batch outputs for fixed inputs, reconciliation of money values, and a parallel run with production-like data.
  • What goes wrong most often in a .NET Framework port? Configuration and identity (Windows auth, web.config), data-access defaults (EF6, SqlClient encryption), and Windows-only dependencies hidden in batch jobs.
  • Would you choose Windows containers? Only as a stop-gap for components that cannot move; they are larger, slower to start and carry a Windows licence cost.

Certification practice

Completion checklist

  • I can explain the difference between .NET Framework and modern .NET in terms of hosting and libraries
  • I ran the scanner on a sample and prioritised its output
  • I can justify a stay, port or strangle decision with evidence
  • I ran the cleanup steps and confirmed nothing is still billing

Key takeaways

  • A port replaces Framework-only pieces; the tools do the mechanical part and you prove equivalence.
  • Scan first, decide second: blockers drive the choice between stay, port and strangle.
  • Write characterisation tests before changing code.
  • Windows authentication and Web Forms are design problems, not search-and-replace problems.
  • Staying on Windows is legitimate when recorded as a deliberate decision.

Further reading

Independent learning resource — not affiliated with, endorsed or sponsored by Amazon Web Services. AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. All banking data in examples is fictional. Sample architectures are for learning and are not automatically compliant with GDPR, PCI DSS or any banking regulation.

On this page