AWS Streamlines .NET Application Deployment with Visual Studio Tool — Visual Studio Magazine


AWS Streamlines .NET Application Deployment with Visual Studio Tool

Amazon Web Services (AWS) has made it easy to deploy .NET applications on its cloud platform through its Visual Studio toolkit or the .NET CLI (Command Line Interface).

From the Visual Studio IDE, the smoother deployment process comes with a new “Publish to AWS” wizard in AWS Toolkit for Visual Studio 2022 in Visual Studio Marketplace, which has been installed over 45,000 times.

It is described as “an extension for Microsoft Visual Studio on Windows that makes it easier for developers to develop, debug, and deploy .NET applications using Amazon Web Services.”

The kit description further reads: “The AWS Toolkit provides Visual Studio project templates that you can use as starting points for the AWS console and web applications. As your application grows is running, you can use AWS Explorer to view the AWS resources used by the application. For example, if your application creates buckets in Amazon S3, you can use AWS Explorer to view those buckets and their contents. If you need to provision AWS resources for your application, you can create them manually using AWS Explorer or use the CloudFormation templates included with the AWS Toolkit to provision web application environments hosted on Amazon EC2.

AWS Toolkit for Visual Studio
[Click on image for larger view.] AWS Toolkit for Visual Studio (source: AWS).

To work with the .NET CLI, the feature is provided with the AWS Deploy Tool for .NET NuGet package.

“With reasonable defaults for all deployment parameters, you can now get your .NET application up and running with a single click, or a few simple steps, without the need for deep AWS expertise,” Amazon said. in a July 6 blog post. “You will receive recommendations on the optimal compute for your application, giving you more confidence in your initial deployments.”

Indeed, these compute recommendations are at the top of the list of key features presented by AWS:

  • Calculation recommendations for your application — Get recommendations on the best compute type for your application based on application type.
  • Dockerfile generation — The tool will generate a Dockerfile if needed, otherwise an existing Dockerfile will be used.
  • Automatic packaging and deployment — The tool creates the deployment artifacts, generates a deployment CDK project, provisions the infrastructure, and deploys your application to the chosen AWS compute.
  • Repeatable and shareable deployments — The tool preserves configuration settings and the AWS Cloud Development Kit (CDK) project used to deploy your application. You can also control their version and share them with other team members for repeatable deployments.
  • Help learning AWS CDK for .NET! — Once you’re ready to start exploring, the Deployment Tool will help you gradually learn AWS tools like CDKs that are used under the hood. It generates well-documented/organized CDK projects that you can easily start modifying to suit your specific use case.
Publish to AWS
[Click on image for larger view.] Publish to AWS (source: AWS).

Several types of applications can be deployed (but not .NET Lambda functions), including:

  • ASP.NET Core Apps
  • Blazor WebAssembly apps built with .NET Core 3.1 and later, including .NET 7 preview
  • .NET console applications, including long-running services for message processing, etc.
  • Scheduled Tasks

As for deployment targets, at this point the new experience can work with Amazon Elastic Container Service (Amazon ECS) using the AWS Fargate compute engine, AWS App Runner, and AWS Elastic Beanstalk. Hosting Blazor WebAssembly applications in Amazon S3 using Amazon CloudFront as the Content Delivery Network (CDN) is also supported.

“The new deployment experience focuses on the type of application you want to deploy instead of individual AWS services by providing intelligent compute recommendations,” AWS said in a separate July 6 post.

“One of the major new features is deployment projects. This new concept allows you to customize deployments in Visual Studio or the CLI, including the user interface, and share them with the rest of your team members. Deployment projects allow teams to come up with custom deployment scenarios while providing their team with interactive or scriptable deployments.”

Meanwhile, the old deployment experiences — “Publish to AWS Elastic Beanstalk” and “Publish Container to AWS” — are still available in the toolkit, although marked as Legacy in the context menu. AWS will not expand these wizards in the future and therefore recommends toolkit users to migrate to the new “Publish to AWS” wizard. Developers are encouraged to open an issue on GitHub” for feedback, such as reporting missing features that block migrations.

More information can be found in the “Using Publish to AWS in Visual Studio” documentation.

About the Author

David Ramel is an editor and writer for Converge360.

Briana R. Cross