When I originally began to dig into Azure, multiple sites per role wasn’t supported. And quite frankly was very important to take down costs for people like me who host lots of little development projects. Fortunately version 1.3 of Azure introduced full flavour IIS 7.5 which mean you can do this. This is great if you have a few websites which don’t really need their own instance each but you want them up there. Hopefully this will allow Azure to take off more, allowing developers and smaller sites to host easily and cheaply on the platform.
How to do it:
Use the following in your ServiceDefinition.csdef file:
<Sites> <Site name="OwenBlog" physicalDirectory="..SampleWebApp"> <Bindings> <Binding name="HttpIn" endpointName="HttpIn" hostHeader="www.owenadavies.co.uk" /> </Bindings> </Site> <Site name="OwenTest" physicalDirectory="c:SampleWebApp"> <VirtualApplication name="testapp" physicalDirectory="c:testapp" /> <Bindings> <Binding name="HttpIn" endpointName="HttpIn" hostHeader="www.testsite.com" /> </Bindings> </Site> </Sites>
You would then set up each of your 2 domains to map to your Azure domain url (http://YOURAPPNAME.cloudapp.net) via a CNAME, and azure will use the hostHeader to figure out which site to server. This is exactly the same mechanism as what is done in IIS if you ran on premises.
I'm a .NET Software Engineer that is currently working at SafeToNet. Opinions are my own.
Nant (1) Load testing (1) Visual studio (1) Azure (24) Aws (1) Asp.net (1) Tfs (1) Puppetlabs reports (2) Devops (2) Iis (1) Powershell (6) Arm templates (2) Arm template (1) Azure (5) Powershell (1) Dsc (1) Arm (1) Jekyll (1) Vsts (1)