Skip to Content
Cloud Engineering Academy
3. .NET Application Development on AWS

Module 3: .NET Application Development on AWS

Build, containerise, configure and deploy ASP.NET Core applications on AWS the way a bank would run them. You compare every hosting option (EC2, Elastic Beanstalk, ECS on Fargate, Lambda and more) and finish by deploying the same Web API three different ways.

DVA-C03SAA-C03

Assumes: .NET 10 LTS · AWS SDK for .NET v4 · Lambda dotnet10 · Region us-east-1. Verified against official sources on 2026-11-18.

Build, containerise, configure and deploy ASP.NET Core applications on AWS the way a bank would run them. You compare every hosting option (EC2, Elastic Beanstalk, ECS on Fargate, Lambda and more) and finish by deploying the same Web API three different ways.

Estimated timeAbout 30 hours (lessons 18 h · labs 8 h · project 4 h)
Priority for you⭐ Critical — priority 1 (deploying .NET on AWS)
LevelBeginner → advanced
CertificationsDVA-C03 (primary) · SAA-C03
Cost profile🟢 local + Lambda · 🟡 Fargate/Beanstalk deploy-and-destroy

Why this matters in banking

Most of your bank's AWS workload will be .NET code you or your colleagues write. Choosing the wrong host costs money every hour (an idle load balancer), creates operational toil (patching Windows servers you didn't need) or causes outages (a container that is killed because its health check is wrong). Regulators and auditors will also ask how secrets are stored, how configuration changes are controlled and how every request can be traced. This module teaches the habits that answer those questions from day one.

From .NET/Azure to AWS

You know (Microsoft/Azure)AWS equivalentWhat's different
IIS on a Windows VMEC2 (Windows or Linux) behind an ALBYou own patching, scaling and AMIs; Linux + Kestrel is cheaper
Azure App ServiceElastic Beanstalk, or ECS Express ModeBeanstalk creates real EC2/ALB resources you can see and pay for
Azure Container Apps / AKSECS on Fargate / EKSECS is AWS-native and simpler; EKS is managed Kubernetes
Azure FunctionsAWS Lambda (dotnet10 runtime)One handler per function, or host a whole ASP.NET Core app inside Lambda
Azure Container RegistryAmazon ECRBuilt-in vulnerability scanning and lifecycle policies
Managed identityIAM roles for EC2 instances, ECS tasks and Lambda functionsThe SDK picks up temporary credentials automatically — no keys in config
App Configuration / Key VaultSSM Parameter Store, AWS AppConfig, Secrets ManagerConfiguration, feature flags and secrets are three separate services
Application Insights loggingCloudWatch Logs (+ X-Ray / OpenTelemetry)You ship structured JSON logs; queries use Logs Insights
WebJobs / Windows ServicesWorker Service on Fargate, Lambda, EventBridge SchedulerSchedules live outside the app as managed rules
Porting tools / Upgrade AssistantAWS Transform for .NET + .NET Upgrade AssistantAWS Transform is agentic and replaced Porting Assistant (see notes below)

Learning objectives

By the end of this module you can:

  • Register AWS SDK v4 clients through dependency injection with sensible retries, timeouts and Region settings, and explain the credential provider chain.
  • Choose a hosting option for a given .NET workload and defend the choice on cost, operations, scaling and cold starts.
  • Write a secure multi-stage Dockerfile (small base image, non-root user) and push it to ECR with scanning on.
  • Layer configuration from appsettings.json → environment variables → Parameter Store/AppConfig, and read secrets from Secrets Manager with caching.
  • Add liveness/readiness health checks that ALB, ECS and Lambda-fronting services can use correctly.
  • Emit structured JSON logs with correlation IDs and return ProblemDetails errors from a global exception handler.
  • Protect an API with Cognito-issued JWTs and policy-based authorisation, and give the running code least-privilege IAM permissions.
  • Run background work as hosted services, SQS consumers or scheduled jobs.

Prerequisites

How the pieces fit

The default answer for a new banking API is ECS on Fargate behind an ALB in private subnets. Lambda wins for event-driven and spiky work; EC2 and Beanstalk remain for legacy and lift-and-shift.

Lessons

  1. AWS SDK for .NET v4 in depth — clients, credential provider chain, profiles, Region config, retries, timeouts, pagination and async patterns.
  2. AWS clients and dependency injection — AWSSDK.Extensions.NETCore.Setup, client lifetimes, per-environment options and testing with fakes.
  3. Lab 3.1: an SDK v4 console app — the hands-on checkpoint for lessons 1 and 2.
  4. ASP.NET Core Web API on AWS: the baseline — Kestrel behind a load balancer, forwarded headers, HTTPS termination and the bank's reference API.
  5. Hosting options compared — EC2 (Linux and Windows), Elastic Beanstalk, ECS on Fargate, ECS on EC2, EKS overview, Lambda, ECS Express Mode, and why App Runner is no longer an option for new accounts.
  6. Containerising .NET — multi-stage builds, chiseled images, non-root user, image size and startup time.
  7. Amazon ECR — private repositories, scan on push, immutable tags and lifecycle policies.
  8. Deploying to ECS on Fargate — task definitions, services, task roles vs execution roles, ALB target groups and private subnets.
  9. Elastic Beanstalk for .NET — the .NET 10 on Amazon Linux 2023 platform, the Windows/IIS platform, and what Beanstalk creates for you.
  10. Lambda with C# — handlers, the Lambda Annotations framework, ASP.NET Core on Lambda, Native AOT, cold starts and SnapStart.
  11. Configuration done right — appsettings, environment variables, Parameter Store and AppConfig, plus feature flags with safe rollout.
  12. Secrets — Secrets Manager with client-side caching, rotation and how to avoid secrets in environment variables.
  13. Health checks — liveness vs readiness, ALB and ECS health checks, grace periods and the restart-loop trap.
  14. Lab 3.2: containerise the Accounts API — a chiseled, non-root image run locally with docker compose.
  15. Lab 3.3: ECR and Fargate — push with scan on push, deploy behind an ALB in private subnets, then destroy.
  16. Scaling .NET apps — target tracking, statelessness, connection-pool sizing, session state in ElastiCache or DynamoDB.
  17. Logging and errors — ILogger/Serilog to CloudWatch, structured JSON, correlation IDs, ProblemDetails and global exception handling.
  18. Authentication and authorisation — Cognito user pools, JWT bearer validation, policy-based authorisation and IAM roles for tasks.
  19. Background processing — Worker Services, hosted services, SQS consumers and EventBridge Scheduler jobs.
  20. Porting .NET Framework apps — AWS Transform for .NET, the .NET Upgrade Assistant and when to rehost on Windows instead.

Labs and module project

The code for the labs and the project is one shared repository folder: labs/m03-accounts-api/ (the Harbourline Accounts API, its tests, a Dockerfile, a compose file and CDK stacks for all three hosts). Its README.md explains how to run it.

  • Lab 3.1 (🟢) — Console app that lists S3 buckets and calls STS GetCallerIdentity using an SSO profile and DI-registered clients.
  • Lab 3.2 (🟢) — Containerise the reference API with a chiseled, non-root image and run it locally with docker compose.
  • Lab 3.3 (🟡) — Push to ECR with scan on push, deploy to Fargate in private subnets behind an ALB, then destroy.
  • Lab 3.4 (🟢) — The same API on Lambda with the dotnet10 runtime and an HTTP API (CDK or Terraform); replay an API Gateway event, read cold starts from the REPORT lines, and compare memory sizes, ReadyToRun and SnapStart. Native AOT is covered as a design discussion in Lambda with C#, because this API's reflection-based dependencies are not AOT-ready.
  • Lab 3.5 (🟡) — Parameter Store and Secrets Manager configuration with caching and a rotated secret: change a feature flag without a restart, read a key through the client-side cache, rotate it, and decide what that does to log correlation.

Module project (🟡): one API, three hosts. Deploy the Accounts API (fictional data) to Elastic Beanstalk, ECS on Fargate and Lambda + API Gateway. Measure each with the same latency probe, price each with a stated cost model, write a one-page comparison of cost, p95 latency, cold start, deployment effort and operational burden, and record your recommendation as an architecture decision record (ADR). The code, CDK stacks, a Terraform variant for the Lambda host, and the probe are in labs/m03-accounts-api/.

When you finish, keep the Module 3 cheat sheet handy for revision.

Cost profile

PartLabelFree alternative
SDK, DI, Docker, configuration, logging labs🟢 freeRun locally; use AWS Emulator or SAM local for S3/SQS/Lambda calls
Lambda + HTTP API deployment🟢 freeWithin the Lambda always-free allowance for lab traffic
ECS on Fargate + ALB🟡 creditsDeploy, test and destroy within an hour; ALB and Fargate bill per hour
Elastic Beanstalk🟡 creditsUse a single-instance environment (no load balancer) and terminate it the same day
Secrets Manager🟡 creditsParameter Store SecureString for labs (free standard parameters); learn rotation design-only
EKS🔴 paidDesign-only exercise; the control plane bills hourly. Use ECS instead for hands-on

Certification alignment

ExamDomains (weight)What this module covers
DVA-C03Development (30%) · Security (26%) · Test & Deploy (22%) · Troubleshoot (22%)SDK use, Lambda, containers, secrets, deployment, logging
SAA-C03High-Performing (24%) · Cost-Optimized (20%)Choosing compute, scaling and cost trade-offs

The domain labels are short forms; see each exam page for the official wording.

Service availability notes

Services that changed — verified 2026-11-17

AWS App Runner is in maintenance and closed to new customers (announced 2026-03-31). AWS recommends Amazon ECS Express Mode instead, which provisions Fargate, an ALB and auto scaling from a container image at no extra charge beyond the resources it creates.

Porting Assistant for .NET, App2Container, the AWS Toolkit for .NET Refactoring and Microservice Extractor closed to new customers on 2025-11-07. AWS Transform for .NET (GA May 2025) is the recommended replacement.

Elastic Beanstalk is active and offers a .NET 10 platform branch on Amazon Linux 2023.

Lambda SnapStart supports .NET managed runtimes from .NET 8; confirm dotnet10 support and current Region coverage before the lab ⚠ VERIFY.

Key AWS services

AWS SDK for .NET v4 · Amazon EC2 · AWS Elastic Beanstalk · Amazon ECS (Fargate, EC2, Express Mode) · Amazon EKS (overview) · AWS Lambda · Amazon API Gateway · Elastic Load Balancing (ALB) · Amazon ECR · AWS Systems Manager Parameter Store · AWS AppConfig · AWS Secrets Manager · Amazon Cognito · Amazon CloudWatch Logs · AWS X-Ray · Amazon EventBridge Scheduler · Amazon SQS · Amazon ElastiCache · AWS Transform for .NET

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