Search code examples
asp.netazuresubdomainmulti-tier

Dynamic subdomain in azure


I'm building a multiTenancy application with asp.net, on top of windows Azure.

The requirements are that any time a tenancy register in our app a subdomain is created for that tenancy in order to operate with the application.

So I would like to programmatically create a new subdomain any time a client is registered and redirect to such subdomain whenever any of its users log in the application.

Is that possible in Azure?

If yes, any advice or recommendation?


Solution

  • Different approaches are described in the old but good book about development of the multi-tenant applications on Azure (see the Option 1 — Using Authentication).

    I believe that creating the a brand new subdomain every time the user is registered can be cumbersome, especially if you are using some domain registrar. I would propose you to consider the approach when you use wildcard DNS entry that resolved all of the subdomains to some IP (backend). In the code, then, the subdomain is being extracted and you use it for further processing.