We have 3 public facing web applications which we are migrating to Azure. All sites use port 80.
OPTIONS
As far as I understand, there are three different options when using Web Roles:
1. All 3 sites hosted in ONE web role in a single cloud service:
- HTTP access can be configured by hostHeader in
ServiceDefinition.csdef - This is the cheapest
- Requires that all projects need to be published at the same time
- The sites cannot be scaled separately, only as a whole
- 1 Cloud Service project in Visual Studio
2. Each site hosted on a SEPARATE web role in a single cloud service:
- HTTP access can be configured by hostHeader in
ServiceDefinition.csdef - Each site will have their own instance
- Requires that all projects need to be published at the same time
- The sites CAN be scaled separately
- 1 Cloud Service project in Visual Studio
3. Each site hosted on a web roles in SEPARATE cloud services:
- Each site will have their own cloudapp.net DNS and IP
- Each site will have their own instance
- Sites can be published separately
- The sites CAN be scaled separately
- Multiple Cloud Service projects in Visual Studio
Is there anything else significant which I am missing?
POSSIBLE SOLULTION
A combination of option 1 and 2.
Hosting everything in one cloud service: Publishing them all together is fine since they all reference a common library project which would need to be updated consistently across all projects.
Hosting two sites in one web role: They can be scaled together fine.
Hosting the third site in it's own web role Will needs its own scaling because of massive peak demands.
ServiceDefinition.csdef:
<ServiceDefinition name="WebTestCloudService.Test" xmlns="..." schemaVersion="2012-10.1.8">
<WebRole name="AzureWebTest1" vmsize="Small">
<Sites>
<Site name="AzureWebTest1">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="test1.mydomain.com" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
</WebRole>
<WebRole name="AzureWebTest2" vmsize="Small">
<Sites>
<Site name="AzureWebTest2">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="test2.mydomain.com" />
</Bindings>
</Site>
<Site name="AzureWebTest3" physicalDirectory="..AzureWebTest4">
<Bindings>
<Binding name="Endpoint1" endpointName="Endpoint1" hostHeader="test3.mydomain.com" />
</Bindings>
</Site>
</Sites>
<Endpoints>
<InputEndpoint name="Endpoint1" protocol="http" port="80" />
</Endpoints>
</WebRole>
</ServiceDefinition>
Please confirm that I am on the right track? Any input would be appreciated.