Working with Publish to AWS in Visual Studio - AWS Toolkit for Visual Studio

Working with Publish to AWS in Visual Studio

Publish to AWS is an interactive deployment experience that assists you with publishing your .NET applications to AWS deployment targets, supporting applications targeting .NET Core 3.1 and later. Working with Publish to AWS keeps your work flow inside of Visual Studio by making these deployment features available, directly from your IDE:

  • The ability to deploy your application with a single click.

  • Deployment recommendations based on your application.

  • Automatic Dockerfile creation, as is relevant and required by your deployment destination's environment (deployment target).

  • Optimized settings for building and packaging your applications, as required by your deployment target.

Note

For additional information about publishing .NET Framework applications, see the guide Creating and deploying .NET applications on Elastic Beanstalk

You can also access Publish to AWS from the .NET CLI. For more information, see the Deploy .NET applications on AWS guide.

Prerequisites

To successfully publish .NET applications to an AWS service, install the following to your local device:

  • .NET Core 3.1+(which includes .NET5 and .NET6): For additional information about these products and download information, visit the Microsoft download site.

  • Node.js 14.x or later version: Node.js is required to run AWS Cloud Development Kit (AWS CDK). To download or obtain more information about Node.js, visit the Node.js download site.

    Note

    Publish to AWS utilizes AWS CDK to deploy your application and all of its deployment infrastructure as a single project. For more information about AWS CDK see the Cloud Development Kit guide.

  • (Optional) Docker is used when deploying to a container-based service such as Amazon ECS. For more information and to download Docker, see the Docker download site.

Supported application types

Before publishing to a new or exiting target, begin by creating or opening one of the following project types in Visual Studio:

  • ASP.NET Core application

  • .NET Console application

  • Blazor WebAssembly application

Publishing applications to AWS targets

When publishing to a new target, Publish to AWS will guide you through the process by making recommendations and using common settings. If you need to publish to a target that was set up previously, your preferences are stored and can be adjusted, or are immediately available for one-click deployment.

Publish to a new target

The following describes how to configure your Publish to AWS deployment preferences, when you're publishing to a new target.

  1. From the AWS Explorer, expand the Credentials drop-down menu, then choose the AWS profile that corresponds with the region and AWS services that are required for your deployment.

  2. Expand the Region drop-down menu, then choose the AWS region that contains the AWS services that are necessary for your deployment.

  3. From the Visual Studio Solutions Explorer pane, open the context menu for (right-click) the project's name, and choose Publish to AWS. This will open Publish to AWS.

  4. From Publish to AWS, choose Publish to New Target to configure a new deployment.

    Note

    To modify your default deployment credentials, choose or click the Edit link located next to the Credentials section, in Publish to AWS.

    To bypass the target configuration process, choose Publish to Existing Target, then pick your preferred configuration from the list of your previous deployment targets.

  5. From the Publish Targets pane, choose an AWS service to manage your application deployment.

  6. When you are satisfied with your configuration, choose Publish to start the deployment process.

    Note

    After initiating a deployment, Publish to AWS displays the following status updates:

    • During the deployment process, Publish to AWS displays information about the deployment's progress.

    • Following the deployment process, Publish to AWS indicates if the deployment succeeded or failed.

    • After a successful deployment, the Resources panel offers additional information about the resource that was created. This information will vary depending on the type of application and deployment configuration.

Publish to an existing target

The following describes how to republish your .NET application to an existing AWS target.

  1. From the AWS Explorer, expand the Credentials drop-down menu, then choose the AWS profile that corresponds with the region and AWS services that are required for your deployment.

  2. Expand the Region drop-down menu, then choose the AWS region that contains the AWS services that are necessary for your deployment.

  3. From the Visual Studio Solutions Explorer pane, right-click the project's name and choose Publish to AWS to open Publish to AWS.

  4. From Publish to AWS, choose Publish to Existing Target to select your deployment environment from a list of existing targets.

    Note

    If you have recently published any applications to the AWS Cloud, those applications are displayed in Publish to AWS.

  5. Select the publishing target that you want to deploy your application to, then click Publish to start the deployment process.