Domain or binding name for azure compute emulator

不打扰是莪最后的温柔 提交于 2019-12-06 03:23:29

问题


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!


回答1:


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.




回答2:


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




回答3:


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



来源:https://stackoverflow.com/questions/10150685/domain-or-binding-name-for-azure-compute-emulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!