AWS Public Sector Blog
Five best practices for building .NET on AWS
Amazon Web Services (AWS) knows how to run .NET applications, and provides .NET developers with resources for building, testing, deploying, and running their .NET applications. Watch our on-demand webinars to learn about migrating and building serverless or container-based apps on AWS.
For .NET developers new to AWS, it is important to know about the tools, services, and features that will help. Below are five tips for getting the most out of .NET on AWS:
Know the tooling
AWS provides a range of developer tools, software development kits (SDKs), and command-line interfaces (CLIs) to improve the .NET developer experience. Most .NET developers rely on Visual Studio to build their applications. By installing the AWS Toolkit for Visual Studio, developers can quickly and easily deploy their applications to AWS Elastic Beanstalk, AWS Lambda, and Amazon Elastic Container Service (Amazon ECS). The toolkit includes AWS Explorer and provides developers with the ability to view and manage their AWS environment without having to leave Visual Studio.
Know how to debug
Most developers have been faced with an application that works perfectly in one environment, but doesn’t work as expected in another. In these scenarios, it can be useful to step through the application’s code line by line to identify the issue. AWS Elastic Beanstalk can be configured to allow remote debugging, enabling developers to debug their applications directly in the AWS cloud.
Serverless applications are typically built with a number of different services. For example, an Amazon API Gateway is often used to invoke one or more AWS Lambda functions over HTTPS. These applications can sometimes be challenging to test and debug, however the AWS SAM CLI enables developers to easily test and debug their serverless applications on their local machines and as part of a continuous integration / continuous deployment (CI/CD) pipeline.
Know how to monitor and log .NET workloads
Things go wrong in software development. When this happens, developers should have the information to resolve the issue quickly. AWS provides developers with monitoring, logging, and instrumentation services so users are informed of issues as quickly as possible.
Amazon CloudWatch Application Insights for .NET and SQL Server leverages Amazon SageMaker’s machine learning capabilities to automatically create dashboards to visualize issues as they arise.
AWS X-Ray distributed tracing system provides tracing and instrumentation services and can analyze the behavior of distributed applications and microservices.
Amazon CloudWatch Alarms can be configured to watch one or more metrics and to take one or more actions based on the value of those metrics. Amazon CloudWatch Alarms make it possible to identify and fix issues before they are noticed by users.
Know about infrastructure-as-code
Application environments should be provisioned quickly and consistently. Most developers have experienced the pain of working in test environments that differ from production environments. Infrastructure-as-code is the process of codifying the infrastructure that an application depends upon. Infrastructure-as-code has some advantages over manually configuring environments, for example:
- Infrastructure code can be persisted alongside application code in source control.
- Environments can be quickly and easily spun up and torn down on an ad hoc basis or as part of a CI/CD pipeline.
- It guarantees all environments, from development through to production, are identical.
AWS has long supported infrastructure-as-code with AWS CloudFormation, however, the recent release of AWS Cloud Development Kit improves upon infrastructure-as-code by providing developers with the ability to build and maintain infrastructure using familiar languages like C++ and VB.NET.
Know how to manage the environment
There are tools and services available to simplify the management of Windows workloads on AWS.
AWS Tools for Windows PowerShell provides developers and administrators with the ability to fully manage their AWS environment via PowerShell scripts.
AWS Systems Manager simplifies the management and maintenance of a fleet of Windows Amazon EC2 instances.
These tools make building a .NET application on AWS easier. To learn about all the resources available for .NET developers and watch on-demand webinars where solution architects demo AWS Tools for Windows, visit our new resources page “Build .NET on AWS.”