Microsoft Workloads on AWS

Get started with .NET Development on AWS using Quick Starts

This is the first part of a blog series dedicated to getting started with .NET development on AWS using AWS Quick Starts for .NET. We will introduce you to an automated reference deployment, the .NET Development Environment Quick Start. It reduces the manual steps needed to set up a .NET development environment on AWS so that you can create and start using your environment in minutes.

.NET developers are increasingly moving away from building applications for on-premises hosting to architectures that use the Amazon Web Services (AWS) Cloud. Many haven’t had an opportunity to work with, or even consider working with a cloud-native development. When they do, they realize the additional benefits of the cloud to innovate and reduce costs. The AWS services and features available to developers make it an exciting time to be a .NET developer and think about the art of the possible.

Anatomy of a Quick Start

AWS Quick Starts are automated reference deployments for specific and well-defined workloads on the AWS Cloud. Each Quick Start launches, configures, and runs AWS compute, network, storage, and other services required to deploy a specific workload on AWS.

AWS Quick Starts for .NET help developers get started by providing reference deployments for common .NET application architectures on AWS. They are built by AWS solutions architects and AWS Partners and are based on AWS Well-Architected principles. They are designed to reduce manual intervention to just a few steps so you can build and start using your environments within minutes.

Each Quick Start includes the following sections:

Sections of a Quick Start

Figure 1: Sections of a Quick Start

  1. Introduction – Provides a short description of who the Quick Start is for, the solution it provides, the challenges it helps solve, and the benefits of the architecture.
  2. What you’ll build – This section contains:
    • A list of AWS resources that constitute the solution and are deployed by the Quick Start.
    • A reference architecture diagram that visualizes the resources that will be deployed by the Quick Start and the relationships between them.
    • A link to a detailed deployment guide that not only acts as a step-by-step guide on how to deploy the Quick Start, but also provides more information like the goal for the Quick Start, pre- and post-deployment steps, FAQs, and notices.
    • A link to the GitHub repository containing the source code for the AWS Quick Start. You can download or clone the source code repo and make modifications to suit your specific needs.
  3. How to deploy – Every Quick Start is accompanied by an AWS CloudFormation template that defines the infrastructure for the solution. The Quick Start provides a link to launch the CloudFormation template, both from the Quick Start home page and from within its deployment guide.
  4. Cost and licenses – Information on cost estimation and notes on third-party licensing is provided with each Quick Start. Where applicable, the cost will be broken down by AWS Service. If there are any assumptions made on the dimensions of AWS Services and usage, they will be mentioned as well.

Setting up a .NET development environment using the AWS Quick Start

For .NET developers who want the flexibility to develop both .NET and .NET Framework applications on AWS, debug their code in their development environment, or work with the tools and services they are accustomed to, AWS has created the .NET Development Environment Quick Start.

This Quick Start provides a development environment pre-configured with commonly used tools for developing .NET and .NET Framework applications.

In the following sections, we will guide you on how to deploy it and get ready to start developing .NET applications using this Quick Start.

Architecture

Figure 2 shows the architecture of the .NET Development Environment that is deployed by the Quick Start. You can read more about it in the Architecture and the Resource quotas sections of the Quick Start deployment guide.

Reference architecture diagram

Figure 2: Reference architecture diagram

The core component of the architecture is a single Amazon Elastic Compute Cloud (Amazon EC2) instance that will be used as your development environment. As part of the deploy process, the following software will be installed into that instance:

A Windows Task Scheduler job with the name Refresh AWS Credentials is configured on the instance and runs every time you log in. This job runs the PowerShell script located at C:\AWS\UpdateProfileCredentials.ps1, which will take the current credentials for the IAM role assigned to the instance and store them locally. Having an AWS credentials profile is necessary for the AWS Toolkits to work correctly.

This PowerShell script will overwrite the previous contents of the AWS credentials file when you log into the instance. If you configured custom profiles during a session with the instance, the next time you log back in, they will be overwritten. If this is not the behavior you want, go to the Windows Task Scheduler and disable the task by selecting Refresh AWS Credentials and choosing Disable in the Selected Item section (see Figure 3).

Task Scheduler job disabling

Figure 3: Task Scheduler job disabling

Deployment

It is important that you read the Planning the deployment section of the deployment guide to make sure you meet all the prerequisites before deploying the Quick Start.

Once you have reviewed and met the requirements for this Quick Start, you are ready to deploy its CloudFormation template into your AWS account.

You have two options on how to deploy the CloudFormation template using the AWS Console:

After you have chosen one of the previous options, choose Next to be presented with the parameters you will use to deploy the stack.

CloudFormation stack parameters

Figure 4: CloudFormation stack parameters

Enter a value for Stack name that you will use to identify the Quick Start in the CloudFormation console.

The parameters VPC ID and Subnet ID are optional. If you do not provide them, CloudFormation will create a new Amazon Virtual Private Cloud (Amazon VPC) for you. If you do not have a VPC configured already, this is a simple way to provision one.

The parameter Allowed CIDR block is used to limit the IPs from which you can remotely access the Amazon EC2 instance. You define this access using a Classless Inter-Domain Routing (CIDR) block. A value of 0.0.0.0/0 allows access from any IP address.

The parameter EC2 key pair is required and enables you to connect to the Amazon EC2 instance. If you do not have an EC2 key pair already created, you can follow the steps in the product documentation to create a new one.

The parameter EC2 instance type is limited to the most common instance types used for development environments. The list of all available EC2 instance types is listed on the Amazon EC2 Instance Types page. If you want to use a different instance type than is included in the Quick Start, you can download the CloudFormation template and edit the AllowedValues property for the InstanceType parameter with the instance types you desire.

The parameter Windows EC2 AMI ID defines the Amazon Machine Image (AMI) used to create the development environment. If you have an AMI you want to use, replace the default value with the ID of your custom AMI . You can also use AWS Systems Manager Parameter Store parameters to get the latest available image for your specific region and type of operating system. You can read more about how to query for the different parameters available in this AWS blog post.

The parameters Quick Start S3 bucket name, Quick Start S3 key prefix and S3 bucket Region specify an Amazon Simple Storage Service (S3) bucket location where additional supporting files used during the launch of the development environment are stored. You should only change these parameters if you want to do an advanced customization as described on the Quick Start website. If you want to take a deeper look at those supporting files, you can explore them on GitHub.

After entering the parameters, choose Next. On the Configure stack options page, review the tags you want to use as well as other advanced options and choose Next. Review the stack configuration and acknowledge the creation of IAM roles by selecting I acknowledge that AWS CloudFormation might create IAM resources. Choose Create stack.

The CloudFormation stack will start deploying, and may take up to 50 minutes to complete. Once it has finished, there will be two outputs for the stack in the CloudFormation console, VInstanceAddress, which is the DNS name used to reach the instance, and VInstanceId, which is the resource ID for the Development Environment EC2 instance.

CloudFormation stack outputs

Figure 5: CloudFormation stack outputs

You now have a fully configured Amazon EC2 instance ready for you to develop both .NET and .NET Framework applications.

Usage

To access the newly created development environment, you need to connect to the Amazon EC2 instance deployed as part of the CloudFormation template. Navigate to the Amazon EC2 console and select the Amazon EC2 instance with Instance ID that is the same as the value of the VInstanceId CloudFormation output. Once selected, you will see information about the Amazon EC2 instance, including public and private IP addresses, and the DNS assigned to it. You will have the option to remotely connect to the instance by choosing Connect.

Development EC2 instance networking configuration

Figure 6: Development EC2 instance networking configuration

There are different methods to remotely access the Amazon EC2 instance, including using a Remote Desktop (RDP) client, RDP using Systems Manager Fleet Manager, or Systems Manager Session Manager. You can read more about these options for connecting to the Amazon EC2 instance in the Amazon EC2 product documentation.

Once connected to your Windows server, there will be shortcuts on the Desktop for some of the applications installed during the configuration process. The user account you are logging in with has Administrator rights, so you can freely install any other framework or dependency you need.

Development instance desktop

Figure 7: Development instance desktop

In AWS, you pay for Amazon EC2 instances by the second, so it is a good practice to stop (not terminate) your development environment instance when you are not using it. Stopping your instance outside of business hours can result in up to 70% cost savings over running it all the time. You can automate this with AWS Instance Scheduler, which allows you to set rules and schedules to stop or start your Amazon EC2 instances.

Costs and licenses

You are responsible for the cost of the AWS services and any third-party licenses used while running the .NET Development Environment Quick Start reference deployment. There is no additional cost for using the Quick Start.

The .NET Development Environment Quick Start includes a trial license for JetBrains Rider. If you want to use JetBrains Rider in your production environment, you must purchase your own license. For details, open the Rider subscription options and pricing and the instructions to register JetBrains Rider.

The AWS CloudFormation templates for this Quick Start include configuration parameters that you can customize. Both the EC2 instance type and Windows EC2 AMI ID parameters affect the cost of deployment. For cost estimates, visit the pricing pages for each AWS service you use. Prices are subject to change.

Tip: After you deploy the Quick Start, create AWS Cost and Usage Reports to deliver billing metrics to an Amazon S3 bucket in your account. These reports provide cost estimates based on usage throughout each month and aggregate the data at the end of the month. For more information, open What are AWS Cost and Usage Reports?

Cleanup

If you no longer want to keep the resources created by this Quick Start in your AWS account, open the CloudFormation console, select the stack you created as part of the Quick Start, and choose Delete. This will terminate and delete the Amazon EC2 instance deployed and other resources created as a part of the deployment.

If you created a VPC when deploying the Quick Start, be aware that trying to delete the CloudFormation stack after additional resources were provisioned in that VPC will prevent the stack from being completely deleted. In that case, you need to delete those resource manually and then delete the CloudFormation stack.

You are also responsible for deleting any resources you deploy to your AWS account while using your development environment. Those will not automatically be removed if you delete the QuickStart.

Conclusion

Developers and architects can use the AWS Quick Starts for .NET to deploy reference architectures in minutes. These blueprints use AWS best practices to help you get started on your use cases quickly. You can use these reference deployments as a starting point and tailor them to meet your needs.

You can use the .NET Development Environment Quick Start to reduce the manual steps needed to set up a .NET development environment on AWS so that you can start using your environment in minutes.

There are resources available to help you learn AWS services when developing for the cloud. The AWS Developer Center provides tutorials and tools for developers for a variety of programming languages and services.

 .NET on AWS is the home for .NET development on AWS and is a great place to start your .NET on AWS journey. The Windows on AWS blog is a useful resource if you want to be informed on use case-specific technical solutions or customer case studies. The .NET on AWS YouTube playlist is a place to get the latest .NET on AWS sessions and videos. On social media, you can follow the official .NET on AWS Twitter handle to be updated all things .NET on AWS.

You can use these AWS resources to help you get started and dive deeper into specific topics, troubleshooting tips, and best practices for .NET on AWS. You can get additional information from  the API Reference, developer guides, and other documentation that is provided.

If you have any other ideas on how the AWS Quick Start for .NET can help you get started quickly and be more productive, please share them on the official .NET on AWS Twitter handle.


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 AWSContact us to start your modernization journey today.

Cristobal Espinosa

Cristobal Espinosa

Cristobal is a Sr. Solutions Architect at Amazon Web Services. He specializes in helping customers modernize their .NET applications running on AWS. Since 2009, he has helped organizations modernize their legacy .NET applications using open web technologies, Kubernetes, CI/CD and cloud-native services.

Jagadeesh Chitikesi

Jagadeesh Chitikesi

Jagadeesh is a Sr. Microsoft Specialist Solutions Architect at AWS. He worked as a developer and an architect with enterprises of all sizes across healthcare, finance, retail, utility, and government for the last 20 years. He is passionate about cloud and all the innovation happening at AWS.

Saikat Banerjee

Saikat Banerjee

Saikat is an engineering leader at Amazon Web Services (AWS). He specializes in building products that helps customers accelerate seamless integration and delivery of applications on AWS. He currently focuses on products for .NET applications development on AWS and related use cases, with a keen interest in open source software and DevOps innovation.