Search code examples
asp.net-mvcazurehosts-file

How can I setup a development environment to use subdomains in the Azure emulator like on localhost(IIS) using hosts file?


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?


Solution

  • 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