Tutorials ASP.NET Core Complete Tutorial (ShopNest)

Azure SQL Database with ASP.NET Core

Learn Azure SQL Database with ASP.NET Core in our free ASP.NET Core Complete Tutorial (ShopNest) series. Step-by-step explanations, examples, and interview tips on Toolliyo Academy.

On this page
Azure SQL Database with ASP.NET Core — ShopNest
Article 63 of 75 · Module 8: Deployment & DevOps · ShopNest Cloud-First Application
Target keyword: azure sql asp.net core · Read time: ~30 min · .NET: 8 / 9 · Project: ShopNest Cloud-First Application

Introduction

ShopNest cloud-first apps store data in Azure SQL Database — managed SQL Server without patching VMs, with automatic backups and firewall rules.

After this article you will

  • Create Azure SQL on budget tier
  • Configure firewall and connection string
  • Run EF Core migrations against Azure SQL
  • Enable connection resiliency
  • Use Managed Identity for passwordless access

Prerequisites

Concept deep-dive

// Program.cs — Azure SQL with retry
builder.Services.AddDbContext<ShopNestDbContext>(options =>
    options.UseSqlServer(connectionString, sql =>
    {
        sql.EnableRetryOnFailure(maxRetryCount: 5,
            maxRetryDelay: TimeSpan.FromSeconds(30),
            errorNumbersToAdd: null);
        sql.MigrationsAssembly(typeof(ShopNestDbContext).Assembly.FullName);
    }));

// Managed Identity connection (no password)
// Server=tcp:shopnest.database.windows.net;Database=ShopNest;
// Authentication=Active Directory Managed Identity;

Firewall: allow Azure services + your dev IP. Tiers: Basic for dev (~₹500/mo); Standard S2+ for production load.

Hands-on — ShopNest Cloud-First Application

  1. Create Azure SQL server + database in Portal.
  2. Add firewall rule for local IP.
  3. dotnet ef database update against Azure connection.
  4. Enable Query Performance Insight in Portal.
  5. Configure App Service Managed Identity + SQL user.

Common errors & best practices

  • Firewall blocks App Service — enable Allow Azure services or VNet integration.
  • LocalDB connection string in Azure — won't work.
  • No retry — transient fault errors under load.

Interview questions

Q: Azure SQL vs SQL on VM?
A: PaaS managed backups/patching; VM gives full control.

Q: EnableRetryOnFailure?
A: Handles transient Azure SQL throttling (error 40613 etc.).

Summary

  • Azure SQL is managed SQL Server for ShopNest cloud
  • Firewall + connection string first setup steps
  • EF migrations work same as on-prem SQL
  • Managed Identity eliminates password rotation pain

Previous: GitHub Actions CI/CD
Next: Secrets Management

FAQ

Cheapest dev tier?

Basic or serverless DTU — watch auto-pause costs.

Backup?

Automatic PITR; geo-redundant optional for DR.

Questions on this lesson 0

Sign in to ask a question or upvote helpful answers.

No questions yet — be the first to ask!

ASP.NET Core Complete Tutorial (ShopNest)
Course syllabus
Module 1: Foundations
Module 2: Entity Framework Core
Module 3: Dependency Injection & Middleware
Module 4: Authentication & Security
Module 5: Web API
Module 6: Advanced Architecture
Module 7: Testing
Module 8: Deployment & DevOps
Module 9: Real-World Projects
Module 10: Advanced Topics
Toolliyo Assistant
Ask about tutorials, ebooks, training, pricing, mentor services, and support. I use public site content only—not admin or internal tools.

care@toolliyo.com

Need callback? Share your details