Hosting Your ASP.NET Core MVC App on Azure for Free



This content originally appeared on DEV Community and was authored by Rupinder Kaur

Introduction

Whenever you’re building an application that requires authentication, you might wonder how to host it online – especially without incurring costs. One powerful way to achieve this is by deploying it to a cloud platform like Azure.

This post walks you through how to host your ASP.NET Core MVC application on Azure’s Free App Service Tier using GitHub for CI/CD, secure app settings, and modern cloud tools – all at zero cost.

Whether you’re building a portfolio, side project, or want production-ready experience, this guide will get you there step-by-step.

Step 1: Prerequisites

Before we get started:

  • ASP.NET Core MVC app with Identity & Tailwind

  • Visual Studio 2022+ or VS Code

  • .NET SDK 7 or later

  • GitHub account (with repo for your app)

  • Azure account (Free Tier: https://azure.microsoft.com/free)

Step 2: Prepare Your App for Azure Deployment

Clean up and prepare your app:

  • Remove debug/seed-only code

  • Add appsettings.Production.json for logs, etc.

  • Store secrets using dotnet user-secrets

Example:

dotnet user-secrets set "Authentication:Google:ClientId" "your-client-id"

dotnet user-secrets set "Authentication:Google:ClientSecret" "your-client-secret"

Run a local publish to confirm it’s build-ready:

dotnet publish -c Release

published folder

Step 3: Set Up Azure App Service

  1. Go to Azure Portal → Create Resource → App Service

  2. Fill required fields:

Field Value
Name expenseManagement-yourname
Stack .NET 7 or later
OS Linux or Windows
Region your closest location
Plan F1 (Free Tier)

create app service

Click “Create” and wait for deployment to complete.

Step 4: Connect to GitHub for Continuous Deployment

Go to Azure Portal → App Service → Deployment Center and fill the below information:

  • Source: GitHub

  • Build: GitHub Actions

  • Repo: your project

  • Branch: main or master

This auto-generates a GitHub Actions YAML file that builds and deploys on every push!

Step 5: Configure App Settings & Secrets in Azure

In Azure → App Service → Configuration:

Name Value
Authentication:Google:ClientId your-client-id
Authentication:Google:ClientSecret your-client-secret
ConnectionStrings:DefaultConnection SQL Server conn string (if used)
ASPNETCORE_ENVIRONMENT Production

After saving, restart the app to apply changes.

Step 6: Test Your Deployed App Live

Your site is now live at:

https://your-app-name.azurewebsites.net

Test:

  • UI, navigation, Tailwind styles

  • OAuth login (Google)

  • Identity and user creation

  • DB entries & logs

Conclusion & What’s Next

Congratulations! 🎉 Your ASP.NET Core MVC app is now hosted in the cloud – securely and for free.

You’ve learned how to:

  • Deploy to Azure’s Free App Service Tier

  • Connect CI/CD with GitHub Actions

  • Secure secrets using App Settings

  • Push real projects live to the web

📢 If you found this helpful:

  • 💬 Drop a comment
  • 🧵 Follow me here on Dev.to and LinkedIn


This content originally appeared on DEV Community and was authored by Rupinder Kaur