2

I have this working in an MVC project on IIS by adjusting the hosts file.

When running an Azure project, I can see some ports getting remapped, not sure what thats doing or how I can set up subdomains, is it also done in the hosts file?

Cœur
  • 32,421
  • 21
  • 173
  • 232
Mark Redman
  • 22,537
  • 19
  • 88
  • 134

1 Answers1

2

Working with subdomains is possible in Windows Azure. If you need to map these subdomains to different web applications, you'll need to map these in your service configuration (hostHeader attribute):

<Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="app.litware.com" />

When developing locally, you can do this using host headers like you described. If you want to deploy to production, you'll need to configure a CNAME on your domain.

Resources

Sandrino Di Mattia
  • 24,394
  • 2
  • 55
  • 64
  • Hi Sandrino, thanks! The subdomains will all be for 1 application (identifying tenant accounts) To confirm I dont' touch the binding and only adjust the headers? I have this working on a non-azure app, so will just need to figure out the port issues etc..not sure if that is clashing, I assume I can run localhost on multiple ports? or create some kind of new dev domain? ....Will check out the links... – Mark Redman Apr 13 '12 at 12:04
  • If this is all for a single application, you won't need to add the hostHeader attribute. You can simply work with a CNAME or the c:\windows\system32\drivers\etc\hosts file. The "port issue" is only present when working with the emulator because the port is already in use (maybe the default website in IIS). – Sandrino Di Mattia Apr 13 '12 at 12:11
  • Stopped the Default Site and restarted IIS (and VS!) and runs fine. Thanks. – Mark Redman Apr 13 '12 at 12:57