Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sub domain mapping in windows azure

I am working on a Task Management System using VS 2010, WCF and Windows Azure. This is a simple personalized task management application. The application allows users to organize and share their task. There will be no. of Users in my project. If somebody “Subscribes” to the application, then we will need to create a “Space” for him with a Subdomain or “Subfolder. How can I implement sub domain mapping in windows azure. What is the real advantage of sub domain mapping?

Regards, Ranish

like image 701
Ranish Avatar asked May 25 '11 06:05

Ranish


2 Answers

Just to assist a bit on the other answers.

Azure's main mechanism for routing requests to your instance is to use "CNAME" DNS records - http://en.wikipedia.org/wiki/CNAME_record.

These CNAME records basically tell the clients (browsers) that www.mydomain.com is an alias for myapp.cloudapp.net

Sadly you cannot CNAME a wildcard Depending on your DNS host you may not be able to wildcard CNAME records (see https://serverfault.com/questions/44618/is-a-wildcard-cname-dns-record-valid), so in order to map multiple subdomains to the same Azure instance, then you may need to set up multiple CNAME records - one for each subdomain you want to reroute - i.e. when you sign up customer "new", then you need to add a new CNAME record mapping "new.mydomain.com" to myapp.cloudapp.net

The two suggestions from Joannes and jmac both suggest external services for setting up those mappings. For some other options - and some Amazon C# sample code - see this post http://computerone.co.nz/community/discussion/29/amazon-route-53-dns-request-in-c-using-the-rest-api/p1 (there's also an affordable C# library available on http://www.proactiveit.co.nz/Route53/R53Connect/)

like image 109
Stuart Avatar answered Sep 29 '22 09:09

Stuart


Being able of generating many subdomains linking to a Windows Azure web role is a matter of programmatic reconfiguration of a DNS rather than a matter of web role configuration.

Amazon offers a cloud-based DNS service named Amazon Route 53 that you could use for this purpose. It would work with Windows Azure actually.

Then, within your webrole, you would need to apply some ASP.NET tweaks to grab the host header of the initial web request to grab the actual subdomain being browsed by your users.

like image 33
Joannes Vermorel Avatar answered Sep 29 '22 09:09

Joannes Vermorel