DEV Community

Cover image for Hosting Your ASP.NET Core MVC App on Azure for Free
Rupinder Kaur
Rupinder Kaur

Posted on

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

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"
Enter fullscreen mode Exit fullscreen mode

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

dotnet publish -c Release
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

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

Top comments (3)

Collapse
 
clanleader profile image
ClanLeader • Edited

For testing phase, Azure can be good deal. They have free services but the features is limited. I have tested their service in the past and use SQL server, it made shocked since it cost me around $55/month, it is really super expensive. I made decision to just use Asphostportal for my simple project. It is far cheaper than Azure.

Collapse
 
nathan_tarbert profile image
Nathan Tarbert

this is extremely impressive, you've saved me hours trying to piece this all together myself
you think there's a catch with staying on the free tier for bigger projects

Collapse
 
rupinder_kaur_6730d267d5f profile image
Rupinder Kaur

Thank you so much! I’m really glad the post saved you time — that makes it all worth it 🙌

Regarding the free tier and bigger projects — you’re right to be cautious. The free tier is great for small apps, demos, or MVPs, but it does have limitations like cold starts, limited resources, and lack of custom domain support unless you upgrade.

If you ever outgrow the Azure free tier, some good and affordable alternatives you can explore are:
• Render – generous free tier, easy to deploy full-stack apps, and supports custom domains even on the free plan.
• Railway – developer-friendly, with a great UI and transparent pricing as your project scales.
• Fly.io – ideal for global apps with free-tier support and automatic scaling, plus it’s secure and developer-centric.
• Vercel / Netlify – perfect for frontends or JAMstack-style apps, with built-in CI/CD and free SSL.

Each has its own pros/cons depending on your project type, but they’re all solid, secure options with reasonable pricing when you need to scale.