I have a Azure Project with 2 Web Roles (An Azure Web Site Project and an Azure WCF Service Role). The WCF service is consumed by the Azure Web Site Project and is referred using the "Add Service Reference" option. The website uses URL defined in the in the web.config to connect to the WCF service which works fine in the local dev/Azure compute emulator. In my local dev machine, when I run the solution, the service & website are loaded and executed in the IIS Express with URL "http://127.0.0.1:8080/v1.svc" and the "http://127.0.0.1:81/" respectively.
However when I published the application on Azure Cloud Services, it created a seperate machine/VM/Instance for the website and the service respectively (since they are considered as two different role's).
Now my question is, since Azure assigns the IP for the instances at runtime, how should I dynamically change the URL in the (in Website's web.config) and update the WCF service to enable the website consume the WCF service seamlessly?
Appreciate your time.
Thanks, Karthik.