Hosting multiple domains under one app service

Tom Nicholas 6 Reputation points
2022-02-21T17:30:59.697+00:00

When multiple domains are pointing to a single, dynamic Web App, what domain is displayed in the requestor's address bar?

  1. Site_A.com
  2. Site_B.com
  3. Site_C.com

If a web app visitor navigates to www.Site_C.com/Registration.aspx will Site_C.com be shown in the requestor's address bar?

My app will be shared by multiple users, each with a user-specific domain name. The hope is that if one gets blocked for doing something stupid, the others won't also be blocked.

Thanks,

Tom

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,096 questions
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. Andriy Bilous 11,006 Reputation points MVP
    2022-02-21T20:44:24.017+00:00

    Hello @Tom Nicholas

    You can add as many domain bindings as you want on your Azure App Service (http + https).
    But this is just a binding between the domain name and the application.

    In this case you will have multi-tenant WebApp, which is not a good design. It would be better if you create separate web apps for separate tenants.
    You can have them as part of the same app service plan. You are anyways charged for the app service plan and not web apps. Also this will keep it isolated. If you still insist on single web app, then you will have to handle the routing of the request for corresponding clients in your web application which will be based on the incoming host header for the request. There are lot of caveats to this from what I see

    https://stackoverflow.com/questions/43772971/can-multiple-domains-point-to-the-same-azure-web-app
    https://stackoverflow.com/questions/45142635/can-we-give-multiple-urls-to-one-web-app-in-microsoft-azure-cloud

    All of the web componentsneed to be aware of how to handle requests that arrive with your domain name in their Host request header. Depending on the specific web technologies that WebApp uses, this may require further configuration for each tenant's domain name, which adds extra operational overhead to the onboarding of tenants.

    You can also consider rewriting host headers, so that regardless of the incoming request's Host header, your web server sees a consistent header value. For example, Azure Front Door enables you to rewrite Host headers, so that regardless of the request, your application server receives a single Host header. Azure Front Door propagates the original host header in the X-Forwarded-Host header, so that your application can inspect it, to resolve the tenant.
    https://learn.microsoft.com/en-us/azure/architecture/guide/multitenant/considerations/domain-names#custom-domain-names

    0 comments No comments

  2. Atakan ATALI 1 Reputation point
    2022-02-22T10:36:37.117+00:00

    Hi @Tom Nicholas ,

    I Don't know what you want exactly but you can use 'Azure Front-Door' for managing multiple requests. In 'Front-Door' you can define multiple incoming domain names (sitea.com, siteb.com sitec.com) and you can determine some rules and you can direct all of your domain to one or more back-end sources (app service etc.).

    Also :

    If your app is unique and also uses multiple users, maybe you should consider something like wildcard domain or dynamic stuff? What do you want, exactly? Can you explain more?

    Bests,
    Atakan ATALI

    0 comments No comments