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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With