选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

Deploying an ASP.NET web app to AWS - AWS Toolkit for Microsoft Azure DevOps
此页面尚未翻译为您的语言。 请求翻译

Deploying an ASP.NET web app to AWS

The following tutorial demonstrates how to use the AWS Elastic Beanstalk Deploy Application task to deploy a web application to the AWS Cloud from an Azure DevOps build definition.

Prerequisites

  • The AWS Toolkit for Azure DevOps installed in Azure DevOps or on an on-premises Azure DevOps server.

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

  • An AWS Elastic Beanstalk application and environment.

  • A code project for an ASP.NET Web Application (.NET Framework) or an ASP.NET Core Web Application, which you will push to your Azure DevOps project.

Deploying an ASP.NET application using the AWS Elastic Beanstalk Deploy Application task

Create a new Azure DevOps project and upload your ASP.NET Web Application (.NET Framework) or ASP.NET Core Web Application files to it.

Then, add a new pipeline to the project based on the ASP.NET Core (.NET Framework) template, which will produce a Web Deploy archive for deployment. To follow the screenshots shown, use the classic editor (that is, without YAML).

New build pipeline using classic editor
New build pipeline based on ASP.NET Core (.NET Framework) template

The build process page for this pipeline contains the following default tasks.

Build Definition

Add the AWS Elastic Beanstalk Deploy Application task to the build definition

Select the "+" icon at the top of the task list. Optionally, in the panel on the right, enter something in the search box, for example "AWS", and scroll through the available tasks until you see the AWS Elastic Beanstalk Deploy Application task. Select Add to add it to the bottom of the build definition.

AWS Elastic Beanstalk Deploy Application Task

Click the new task to see its properties in the right pane.

AWS Elastic Beanstalk Deploy Application Task in Position

Configure the task properties

  • AWS Credentials

    If you have already configured AWS credentials for your project, you can select them from the drop-down list. If not, you can add credentials for this task by choosing New next to the AWS Credentials field. For information about filling out the resulting Add AWS service connection form, see Supply task credentials using a service connection.

    This task requires credentials for a user with a policy enabling the user to update an Elastic Beanstalk environment and describe an environment's status and events.

    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 in the Amazon Web Services General Reference.

  • AWS Region

    Set the AWS Region in which the Elastic Beanstalk environment is running (for example, us-east-1, us-west-2).

  • Application Name

    The name you used to create the Elastic Beanstalk application. An Elastic Beanstalk application is the container for the environment for the .NET web application.

  • Environment Name

    The name of the Elastic Beanstalk environment that is associated with the Application Name. An Elastic Beanstalk environment contains the actual provisioned resources that are running the .NET web application.

  • Deployment Bundle Type

    Leave this field set to the default: ASP.NET (Source: Web Deploy Archive).

  • Web Deploy Archive

    The full path to the Web Deploy archive, including the file name of the archive file, which has a .zip extension. The value for this field can be found in the Build Solution task, the DesktopBuildPackageLocation argument in the MSBuild Arguments field. The directory part of the full path is also used in other tasks.

    If, for example, the project was set up according to the instructions here, the value for this field will be "$(build.artifactstagingdirectory)\WebApp.zip" (without the quotation marks).

    Note

    Azure DevOps provides a number of variables that you can use to avoid hard-coded paths.

  • Event poll delay (seconds)

    The time, in seconds, to wait between calls to retrieve the latest events from the deployment to the environment. The default is 5 seconds. For large deployments or slow connections, you might need to increase this value.

Run the build

With the new task configured, you are ready to run the build. Choose Save & queue.

Save and Queue the Build

When the build has completed running, you should see a log similar to the following.

Build Log
隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。