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
.NET 8 SDK installed
An Azure account (portal.azure.com)
An AWS account (aws.amazon.com)
Git or Visual Studio Code (or Visual Studio)
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
Join the conversation! Your thoughts help the community grow.