Deploying an ASP.NET Core Web App to Azure App Service

In this post, we’ll walk through the step-by-step process to deploy an ASP.NET Core Web App to Azure App Service using Visual Studio and the Azure portal.

Deploying an ASP.NET Core Web App to Azure App Service

Getting Started

Microsoft Azure provides a powerful platform for hosting web applications, and Azure App Service is a top choice for deploying ASP.NET Core applications due to its scalability, integration with Visual Studio and GitHub, and managed infrastructure.

Prerequisites

Before you begin, make sure you have the following:
  • NET SDK (latest version recommended)
  • Visual Studio 2022+ with the “ASP.NET and web development” workload installed
  • An Azure account – Create a free account
  • (Optional) Azure CLI installed for command-line deployment

Create a ASP.NET Core Web API Project

  1. Open Visual Studio
  2. Click Create a new project
  3. Select ASP.NET Core Web API
  4. Click Next
  5. Name your project (e.g., MyWebApi)
  6. Choose .NET 6 or later (recommend .NET 8 if available)
  7. Click Create

Create an App Service & Resource Group

In Azure Portal
  1. Go to Azure PortalApp Services+ Create
  2. Fill in:
    • App name (must be unique)
    • Publish: Code
    • Runtime stack: .NET Core 8 (or your version)
    • Region: Closest to your users
    • Resource group: Create new or use existing
  3. Click Review + Create, then Create

Using Azure CLI
az group create --name MyResourceGroup --location eastus
az appservice plan create --name MyAppServicePlan --resource-group MyResourceGroup --sku B1
az webapp create --name MyAspNetApp123 --resource-group MyResourceGroup --plan MyAppServicePlan --runtime "DOTNETCORE|8.0"

Deploy ASP.NET Core Web API

via Visual Studio
  1. Right-click your project in Solution ExplorerPublish
  2. Choose AzureAzure App Service (Windows/Linux)
  3. Select your subscription and target App Service
  4. Click Finish, then Publish

Visual Studio will build and deploy your app automatically. After deployment, your browser will launch the live site.

via GitHub Actions
  1. Push your code to a GitHub repository
  2. In Azure Portal, go to your App Service → Deployment Center
  3. Select GitHub as source and follow the wizard
  4. Azure will create a GitHub Actions workflow for continuous deployment

Using FileZilla

Deploying an ASP.NET Core Web App to Azure App Service using FileZilla involves publishing your application locally, then uploading the files to the Azure App Service via FTPS.

  1. First publish your application locally.
  2. Get Azure App Service FTP Credentials.
  3. Connect to Azure FTP using FileZilla
    • Open FileZilla.
    • Go to File > Site Manager.
    • Click New Site.
    • Enter the following:
      • Protocol: FTPS - FTP over explicit TLS
      • Host: e.g., waws-prod-*.ftp.azurewebsites.windows.net
      • Port: 21
      • Encryption: Use explicit FTP over TLS
      • Logon Type: Normal
      • Username: e.g., yourwebappname\deployment_username
      • Password: Use the password from the publish profile or portal
    • Click Connect.
  4. Upload Your Published Files
    • In FileZilla:
      • Left panel: navigate to your published folder (e.g., bin\Release\net8.0\publish)
      • Right panel: navigate to /site/wwwroot/
    • Delete everything in /site/wwwroot/ (if it’s a new deployment or update).
    • Drag and drop all the files from your local folder to /site/wwwroot/.

Verify Deployment

  1. Go to the Azure Portal → your App Service.
  2. Click Browse or go to https://<yourwebappname>.azurewebsites.net.
  3. Your app should now be live.

Summary

Deploying ASP.NET Core apps to Azure App Service is straightforward and scalable. Whether you're using Visual Studio or GitHub CI/CD, Azure makes it easy to get your apps online with minimal effort.

Thanks

Kailash Chandra Behera

I am an IT professional with over 13 years of experience in the full software development life cycle for Windows, services, and web-based applications using Microsoft .NET technologies.

Previous Post Next Post

نموذج الاتصال