4
votes

I have wcf service application which i host on IIS and runs very well.
now i need to transfer the services to windows azure where i host them into web role.
i am not sure but i have heard that there are different bindings for windows azure
example:
azure has different bindings equivalent to basicHttp,WebHttp.
can i know what exactly i need to do to achieve the same. here is my current service configuration

<service behaviorConfiguration="mybehavior" name="***">
    <endpoint address="mobile" behaviorConfiguration="web" binding="webHttpBinding"
      contract="*" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://127.0.0.1:81/Mobile.svc" />
      </baseAddresses>
    </host>
  </service>

what change does this need Thanks

1

1 Answers

3
votes

You can achieve your goal with web.config transofmrations (and here). The issue with Azure is that there is no localhost, nor 127.0.0.1 there (well, there might be, but nothing is being routed to that local loop address). All you have to do is to change the baseAddress.

In order to change the baseAddress you may do any of the following:

  • use web.config transofmrations and in your web.Release.config put your azure domain name in the base address (http://yourapp.cloudapp.net/, or your custom domain if you are using one)

  • programatically bind the wcf service using the DIP of the role instance (check this and that questions for more information)