ASP.NET Core  

Deploying ASP.NET Core Applications to Azure App Service and AWS Elastic Beanstalk

Building your .NET application is only half the journey — the real value comes when you deploy it to the cloud so users can access it at scale. Two of the most popular Platform-as-a-Service (PaaS) options are Azure App Service and AWS Elastic Beanstalk. Both let you deploy ASP.NET Core applications without worrying about infrastructure.

This article shows you how to deploy the same ASP.NET Core application to Azure App Service and AWS Elastic Beanstalk, step by step.

1. Prerequisites

2. Create a Sample ASP.NET Core App

dotnet new webapp -o MyWebApp
cd MyWebApp
dotnet run

Visit https://localhost:5001 to confirm the app runs locally.

3. Deploying to Azure App Service

Step 1. Install Azure CLI

winget install Microsoft.AzureCLI

Step 2. Log in

az login

Step 3. Create a Resource Group & App Service Plan

az group create --name MyDotNetGroup --location eastus
az appservice plan create --name MyDotNetPlan --resource-group MyDotNetGroup --sku B1 --is-linux

Step 4. Create Web App

az webapp create --resource-group MyDotNetGroup --plan MyDotNetPlan --name my-dotnet-azure-app --runtime "DOTNETCORE:8.0"

Step 5. Deploy with az webapp deploy

dotnet publish -c Release
az webapp deploy --resource-group MyDotNetGroup --name my-dotnet-azure-app --src-path ./bin/Release/net8.0/publish

Now your app is live at:
https://my-dotnet-azure-app.azurewebsites.net

4. Deploying to AWS Elastic Beanstalk

Step 1. Install AWS CLI & EB CLI

pip install awsebcli --upgrade --user
aws configure

Provide your AWS Access Key, Secret Key, region, and output format.

Step 2. Initialize Elastic Beanstalk Project

eb init
  • Select your region (e.g., us-east-1)

  • Choose .NET Core on the Linux platform

Step 3. Create an Environment

eb create my-dotnet-env

This spins up an environment with EC2, a load balancer, and scaling.

Step 4. Deploy the Application

dotnet publish -c Release
eb deploy

Your app will be available at:
http://my-dotnet-env.us-east-1.elasticbeanstalk.com

5. Side-by-Side Comparison

FeatureAzure App ServiceAWS Elastic Beanstalk
Ease of SetupVery simple, tightly integrated with Visual StudioCLI-based setup, flexible configurations
ScalingVertical & horizontal autoscaling built-inAuto-scaling groups, load balancer included
MonitoringAzure Monitor & Application InsightsCloudWatch & X-Ray
Best ForQuick PaaS hosting with minimal configMore customizable deployments with scaling

6. Best Practices

  • Use CI/CD:

    • Azure → GitHub Actions or Azure DevOps Pipelines

    • AWS → CodePipeline + CodeBuild

  • Secure Credentials with Azure Key Vault or AWS Secrets Manager.

  • Enable Monitoring: Always turn on logs for troubleshooting.

  • Autoscale Early: Both platforms can autoscale — configure rules upfront.

Conclusion

Deploying .NET applications to the cloud doesn’t have to be complex. With Azure App Service, you get simplicity and deep integration with the Microsoft ecosystem. With AWS Elastic Beanstalk, you get flexibility and global reach.

By trying both, you can understand their strengths and even adopt a multi-cloud deployment strategy for resilience and redundancy.