Share via

host website with database in Azure

2026-05-18T23:37:49.9533333+00:00

I would like get web hosting for a small web application with database. please guide

Azure SQL Database
0 comments No comments

2 answers

Sort by: Most helpful
  1. SAI JAGADEESH KUDIPUDI 3,215 Reputation points Microsoft External Staff Moderator
    2026-05-19T00:23:08.9033333+00:00

    Hi PROFESOR MADYA TS. DR. NURUL AKMAR BINTI EMRAN,

    Thanks for your question — hosting a website with a database in Azure is definitely a common scenario, and you’re on the right track.

    A simple and recommended approach is to use Azure’s fully managed services:

    • Azure App Service to host your web application
    • A managed database like Azure SQL Database, Azure Database for MySQL – Flexible Server, or Azure Database for PostgreSQL – Flexible Server

    These services are fully managed, meaning Microsoft takes care of patching, backups, and high availability, so you can focus on your application.

    At a high level, you can follow these steps:

    1. Create a Resource Group
    2. Create an App Service Plan and Web App
    3. Create your database server (SQL / MySQL / PostgreSQL)
    4. Configure network access (firewall rules or private endpoint)
    5. Add the connection configuration in your Web App
    6. Deploy your application using your preferred method (Visual Studio, GitHub, etc.)

    Important note about MariaDB

    If you were considering Azure Database for MariaDB, please note that this service is being retired on September 19, 2025, and new MariaDB instances are no longer supported

    Microsoft recommends migrating to Azure Database for MySQL – Flexible Server, which offers better performance, improved architecture, and more flexibility.
    So for new deployments, it’s best to choose MySQL Flexible Server or PostgreSQL Flexible Server instead.

    • Use Managed Identity where possible to avoid storing credentials
    • Restrict database access using firewall rules or private networking
    • Keep your App Service and database in the same region
    • Start with smaller pricing tiers and scale as needed

    Using Azure App Service + a managed database (SQL / MySQL / PostgreSQL) is the most straightforward and production-ready way to host a web app with a database in Azure.

    Microsoft References Link:

    Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.

    Was this answer helpful?


  2. AI answer

    2026-05-18T23:38:00.4033333+00:00

    For a small web app with a database, a common and simple approach is:

    1. Host the web app on Azure App Service
      • Azure App Service is a fully managed web hosting platform (PaaS) that supports .NET, Node.js, Python, Java, PHP, and more.
      • It handles infrastructure, scaling, and built-in load balancing so the focus stays on application code.
      • For most small web apps, App Service Web Apps is the recommended option.
      Basic steps:
      1. Sign in to the Azure portal.
      2. Create a Resource group (for example, myResourceGroup).
      3. Create an App Service plan (defines region, size, and pricing tier).
      4. Create a Web App in that plan.
      5. Deploy the app code (for example, from Visual Studio, VS Code, GitHub, or CLI).
      The Learn module “Host a web application with Azure App Service” walks through:
      • Creating the web app in the portal.
      • Preparing a starter web application.
      • Deploying the code to App Service.
    2. Use Azure SQL Database for the data
      • Azure SQL Database is a fully managed relational database service.
      • It is a common choice for ASP.NET and other web apps needing transactional, relational data.
      Basic steps (from Visual Studio workflow, but conceptually the same if using other tools):
      1. Create an Azure SQL logical server and Azure SQL database in the same region as the web app.
      2. Configure firewall/networking so the App Service can reach the database.
      3. In the web app configuration, set the connection string pointing to the Azure SQL Database.
      4. Optionally configure a managed identity for the web app and use Microsoft Entra ID authentication for secure database access.
    3. End-to-end flow for a small app
      1. Develop the app locally (for example, ASP.NET Core with EF Core pointing to a local SQL Server/SQL Express during development).
      2. In Azure:
        • Create App Service plan + Web App.
        • Create Azure SQL Database.
      3. Update the app’s connection string to use the Azure SQL Database.
      4. Publish/deploy the app to Azure App Service.
      5. Test the app via the web app URL.
    4. When to consider other hosting options
      • For most small, monolithic web apps, App Service + Azure SQL Database is sufficient and recommended.
      • If the app is microservice-based or containerized, consider container hosting options instead.

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.