How to create multiple sub domains in vm

Malusoft India 0 Reputation points
2024-10-19T14:02:13.7633333+00:00

We have setup an Azure VM and was successfully configure one web application in IIS. How can we add more web applications in separate sub domains and database ?

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
775 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,019 questions
{count} votes

1 answer

Sort by: Most helpful
  1. SUNOJ KUMAR YELURU 15,256 Reputation points MVP Volunteer Moderator
    2024-10-19T15:06:18.9466667+00:00

    Hello @Malusoft India

    Thanks for using Q and A forum.

    To add more web applications under separate subdomains, you need to create DNS records for each subdomain. For example, if your main domain is example.com, you can create subdomains like app1.example.com, app2.example.com, etc. This is typically done in your domain registrar's DNS management panel.

    [Configure IIS for New Applications]

    1. Open IIS Manager on your Azure VM.
    2. Right-click on "Sites" and select "Add Website."
    3. Enter the site name, physical path (where your web application files are located), and the subdomain (e.g., app1.example.com).
    4. Click "OK" to create the new site.

    [Set Up Databases]

    1. Open SQL Server Management Studio (SSMS) or your preferred database management tool.
    2. Create a new database for each web application. For example, create App1DB, App2DB, etc.
    3. Configure the connection strings in your web applications to point to their respective databases.

    [Test Configuration]

    1. Ensure that the web applications are accessible via their subdomains.
    2. Test the database connections from each application to verify that they can communicate with their respective databases.

    If this answers your query, do click Accept Answer and Up-Vote for the same. And, if you have any further query do let us know.

    0 comments No comments

Your answer

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