First Elastic Beanstalk Deploy for .NET¶
This tutorial walks through the first deployment of an ASP.NET Core application to AWS Elastic Beanstalk with the EB CLI. The main path uses the Linux platform branch, publishes the app, and deploys a zip bundle built from the publish output.
Prerequisites¶
- Completed 01-local-run.md.
- AWS CLI and EB CLI installed.
- A target region exported as
$REGION. - ASP.NET Core application with
GuideApi.csproj,Program.cs,Procfile, and/healthendpoint.
What You'll Build¶
You will create:
- An Elastic Beanstalk application.
- A Linux web server environment.
- A deployable application version from
dotnet publishoutput. - A repeatable status and health verification path.
Steps¶
- Export working variables.
export APP_NAME="eb-dotnet-guide"
export ENV_NAME="eb-dotnet-guide-dev"
export REGION="ap-northeast-2"
- Initialize Elastic Beanstalk metadata.
- Publish the application.
- Copy Elastic Beanstalk deployment files into the publish folder.
- Create the source bundle from the publish output.
- Create the environment.
- Deploy the current version.
- Check status and health.
flowchart LR
A[dotnet publish] --> B[publish folder]
B --> C[Add Procfile and .ebextensions]
C --> D[eb init]
D --> E[eb create]
E --> F[eb deploy]
F --> G[Health check on /health] Verification¶
Use these commands after the first deploy:
eb status "$ENV_NAME"
eb events "$ENV_NAME" --follow
aws elasticbeanstalk describe-environments --application-name "$APP_NAME" --region "$REGION"
Expected checks:
- Environment status becomes
Ready. - Enhanced health becomes
Greenafter the app answers/health. - Events show a successful application version deployment.
- The environment URL returns the ASP.NET Core root payload.