Menu
AWS Tools for Microsoft Visual Studio Team Services
User Guide

Deploying an ASP.NET Web App to AWS

The following tutorial demonstrates how to use the AWS Elastic Beanstalk Deployment task to deploy a web application to the AWS Cloud from a Visual Studio Team Services (VSTS) build definition.

Prerequisites

  • The AWS Tools for VSTS installed in VSTS or an on-premises Team Foundation Server.

  • An AWS account and preferably an associated IAM user account.

  • An Elastic Beanstalk application and environment.

Deploying an ASP.NET Application Using the AWS Elastic Beanstalk Deployment Task

This walkthrough assumes you are using a build based on the ASP.NET Core (.NET Framework) template that will produce a Web Deploy archive for deployment.


            Select a template

The build process page containing the default tasks for the template is displayed.


            Build Definition

Add the AWS Elastic Beanstalk Deployment Task to the Build Definition

Click the Add Task link. In the right hand panel, scroll through the available tasks until you see the AWS Elastic Beanstalk Deployment task. Click the Add button to add it to bottom of the build definition.


               AWS Elastic Beanstalk Deployment Task

Click on the new task and you will see the properties for it in the right pane.


               AWS Elastic Beanstalk Deployment Task in Position

Configure the Task Properties

For the new task you need to make the following configuration changes.

  • AWS Credentials: If you have existing AWS credentials configured for your tasks you can select them using the dropdown link in the field. If not, to quickly add credentials for this task, click the + link.

    
                     AWS Credential Field

    This opens the Add new AWS Connection form.

    
                     AWS Credential Dialog

    This task requires credentials for a user with a policy enabling the user to update a Beanstalk environment and describe an environment status and events. Enter the access key and secret keys for the credentials you want to use and assign a name that you will remember.

    Note

    We recommend that you do not use your account's root credentials. Instead, create one or more IAM users, and then use those credentials. For more information, see Best Practices for Managing AWS Access Keys.

    Click OK to save them. The dialog will close and return to the Elastic Beanstalk Deployment Task configuration with the new credentials selected.

    
                     AWS Credential Dialog
  • AWS Region: The AWS region that that the Beanstalk environment is running in.

  • Application Type: Set to ASP.NET

  • Web Deploy Archive: The path to the Web Deploy archive. If the archive was created using the arguments above, the file will have the same name as the directory containing the web application and will have a ".zip" extension. It can be found in the build artifacts staging directory which can be referenced as $(build.artifactstagingdirectory).

  • Application Name: The name you used to create the Beanstalk application. A Beanstalk application is the container for the environment for the .NET web application.

  • Environment Name: The name you used to create the Beanstalk environment. A Beanstalk environment contains the actual provisioned resources that are running the .NET web application.

Run the Build

With the new task configured you are ready to run the build. Click the Save and queue option. When the build has completed running you should see a log similar to this.


               Build Log