Alex Pryiomka
Alex Pryiomka

Reputation: 441

Domain or binding name for azure compute emulator

I need to run a Web Role in azure compute emulator under domain name rather than localhost ip address (127.0.0.1). I can configure my project run regular web app on local IIS, so I can use actual domain name rather than development server ip addresses...

My application is very url specific because i use subdomains to define States (US States). For example, i need azure emulator to use something like: http://wa.myapp.net, but not http://127.0.0.1 which doesn't make sense to me.

I have a lot of features that relay on sub-domains in my url. With regular web app I can configure this to run on IIS and set the url in my project (and bindings in IIS), but I don't see any way how I can do it in azure emulator.

Right now I have a work around. I just configured my local IIS to point to the application folder, I can run my app and then just attach my visual studio to iis process. But in this case some features don't work because azure role is not running... so it doesn't quite solve the problem...

Please, need an advice.

Thanks!

Upvotes: 5

Views: 1906

Answers (3)

Bart Verkoeijen
Bart Verkoeijen

Reputation: 17793

The MSDN article Configure a Web Role for Multiple Web Sites explains how to do this.

You can add extra bindings with a hostHeader attribute that specifies a custom domain in ServiceDefinition.csdef.

For example:

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="MyService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2013-03.2.0">
    [...]
    <Sites>
      <Site name="Web">
        <Bindings>
          <Binding name="Endpoint1" endpointName="WebSvc" />
          <Binding name="Endpoint1" endpointName="WebSvc" hostHeader="my.custom.domain.com" />
        </Bindings>
      </Site>
    </Sites>
    [...]
  </WebRole>
</ServiceDefinition>

You still will need to setup the host override on your machine in C:\Windows\System32\drivers\etc\hosts, and navigate to the correct URL.

Upvotes: 2

Alexander
Alexander

Reputation: 614

Also a great tool to forward the request to your azure emulator: http://www.quantumg.net/portforward.php

Upvotes: 0

Rob Rodi
Rob Rodi

Reputation: 3494

You cannot connect to the Dev Fabric from an external server. You can use fiddler on your server to redirect requests from another port to your azure fabric emulator. Hopefully, this is just for development, because it will not scale.

http://www.fiddler2.com/fiddler/help/reverseproxy.asp

Upvotes: 0

Related Questions