Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Two webprojects in the same Azure webrole?

Tags:

c#

web

azure

I am trying to run multiple websites at the same web role. How it can be done?

like image 897
Sergey Avatar asked Jan 13 '23 14:01

Sergey


1 Answers

Creating a web role that contains multiple web sites is pretty easy. Essentially, you need to add multiple elements to your web role’s ServiceDefinition.csdef file. Each element would include a physicalDirectory element that references the location of the web site to be included.

<Sites>
  <Site name="WebRole1" physicalDirectory="..\..\..\WebRole1">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" />
</Bindings>
</Site>
<Site name="WebApplication1" physicalDirectory="..\..\..\WebApplication1\">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint2" />
</Bindings>
</Site>
<Site name="WebApplication2" physicalDirectory="..\..\..\WebApplication2\">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint3" />
</Bindings>
  </Site>
</Sites>

Referance:

http://michaelcollier.wordpress.com/2013/01/14/multiple-sites-in-a-web-role/

and

http://msdn.microsoft.com/en-us/library/windowsazure/gg433110.aspx

Step By Step Approch Link:

http://blog.elastacloud.com/2011/01/11/azure-running-multiple-web-sites-in-a-single-webrole/

Hope its helpful.

like image 182
Freelancer Avatar answered Jan 23 '23 21:01

Freelancer