AWS Developer Blog

.NET 5 on AWS

As long time .NET developers, many of us here at AWS share in the excitement for the GA release of .NET 5. When benchmark results were announced at .NET Conf this summer, these results validated the focus on increasing performance over its predecessor — .NET Core 3.1. Including a 30% socket performance improvement on Linux, 19% JSON serialization improvements, and 230% gRPC performance gain that resulted in gRPC with .NET 5 listed as faster than all but one of 23 frameworks tested. When I talk to customers they are excited about the .NET 5 improvements in runtime performance and that .NET is ready for scalable modernization efforts.

In this post I’ll share ways customers can get more out of their .NET investments on AWS and highlight some of the services and tools that we have worked on to support .NET 5 in four areas covering compute, networking, developer tools and database.

1. Compute

Starting at the processor, customers can choose to build with AWS custom hardware such as the AWS Graviton2 Processor. AWS is the only major cloud provider that enables .NET 5 an ARM64 architecture option today. Amazon EC2 instances running AWS Graviton2 provide up to 40% better price performance over comparable current generation x86-based instances. AWS Graviton2 helps customers running .NET realize ARM64 performance improvements with all .NET 5 Linux supported distributions (Alpine Linux, Debian, and Ubuntu).

To deploy an AWS Graviton2 EC2 instance from the AWS Management Console, select the 64-bit (Arm) radio button option under the Select button as illustrated here:

Amazon Machine Image 64-bit (Arm) selection

AWS supports .NET 5 across a range of compute options. Today customers have unequaled flexibility to run .NET 5 runtimes on 275 Amazon EC2 instance types. First class support for .NET is provided for both Linux and Windows. Soon customers will be able to select .NET 5 runtime components using EC2 Image Builder. In the interim, customers can use a CloudFormation Template sample to install the .NET 5 runtime on an Amazon Machine Image (AMI).

Soon customers will be able to manage and scale deployments for ASP.NET Core 5 web applications with AWS Elastic Beanstalk. They can modernize applications by deploying .NET 5 on Linux instances and leverage shared Application Load Balancers to reduce costs. In the interim, .NET 5 applications can be deployed using the self contained deployment bundle option if Amazon Linux 2 instances are targeted. Within the AWS Toolkit for Visual Studio, select the 64bit Amazon Linux 2 option for the Container type and then select the “Build self contained deployment bundle” option on the Applications Options screen.

Lambda Publish Applicaiton Options

Customers interested in container solutions for hosting their .NET 5 applications can choose from Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes Service (EKS). They can use AWS Fargate, a serverless container engine that supports both ECS and EKS, to remove the need to provision and manage servers. Developers can publish their containers with .NET 5 applications using the AWS Toolkit for Visual Studio.

For those looking for a serverless compute service, they can target .NET 5 runtimes with AWS Lambda using a custom runtime. The Custom Runtime Function blueprint in the AWS Toolkit for Visual Studio has been updated to support .NET 5.

2. Networking

Following the Well Architected approach from AWS, customers can design .NET 5 gRPC solutions on AWS. You can more fully realize the gRPC investments made in .NET 5 with gRPC support launched two weeks ago for Application Load Balancer. AWS is the only major cloud provider who, today, offers gRPC health checks and full status code reporting for gRPC communications. AWS customers are now able to use .NET 5 and gRPC to gain faster communication and operational excellence for their microservice architectures and mobile device communications.

Application Load Balancer with gRPC Health Checks

As illustrated, Application Load Balancers support HTTP/2 traffic end-to-end. This allows gRPC communications between the EC2 instances and clients.

3. Developer Tools

The AWS SDK for .NET provides a consistent coding pattern to access all AWS services, with libraries distributed via NuGet. The latest version of the SDK libraries target .NET Standard 2.0, which is compatible with .NET 5. The AWS Tools for PowerShell enables customers to work with AWS services and resources from command line or script. Developers can also use .NET CLI extensions for command line configuration of .NET 5 applications and AWS services. For customers that are currently using Azure DevOps, the AWS Toolkit for Azure DevOps provides the last mile deployment of .NET 5 applications to AWS. Please update to the latest version of each tool to take advantage of the recent support added.

Customers can use AWS CodePipeline to automate build, test and deploy phases when their .NET 5 application code changes. AWS CodePipeline provides flexibility when orchestrating CI/CD workflows. Customers can choose to incorporate third-party source control utilities such as GitHub or use AWS CodeCommit as their source control service. To build and test .NET 5 applications, AWS CodePipeline can integrate third-party build services including Jenkins or use AWS CodeBuild. Support for targeting .NET 5 in AWS CodeBuild is coming soon.

Both Windows and Linux instances running .NET 5 applications can be monitored with CloudWatch Application Insights. As part of the AWS Distro for OpenTelemetry, the AWS X-Ray team is contributing to the OpenTelemetry .NET open-source project and will use the client as part of their planned OpenTelemetry integration to provide distribute tracing for .NET 5 applications soon.

Applications can incorporate a variety of .NET 5 compatible services that allow those applications to be built faster. Customers can secure sensitive data with AWS Systems Manager Parameter Store or AWS Secrets Manager. The AWS Secrets Manager Caching Client for .NET will provide .NET 5 support soon.

4. Database

Depending on their use case, customers developing .NET 5 applications can interact with any of the AWS relational and non-relational purpose-built database engines. For a fast and flexible NoSQL database service, the AWS SDK for .NET offers several programming models to access Amazon DynamoDB. The Amazon Quantum Ledger Database (QLDB) provides a .NET 5 compatible client for a fully managed ledger database that provides a transparent, immutable, and cryptographically verifiable transaction log. Customers can use Entity Framework (EF) Core, or their choice of .NET data access libraries and frameworks to interact with relational databases stored on AWS. EF Core providers can access both self-hosted and all Amazon Relational Database (RDS) database engines, including Amazon Aurora and Amazon RDS for SQL Server. Customers can use their library of choice to interact with Redis in-memory data stores managed by Amazon ElastiCache.

And we’re just getting started…

Over the next few months, AWS solution architects, developer advocates, and software developers will continue to share why .NET 5 and AWS make a great combination to build modern applications. Please visit the build modern .NET content to learn more about .NET on AWS.