Configure the Site Entry in the Service Definition File
Updated: April 13, 2011
You use the Site element to specify a web site or web application that is hosted in Internet Information Services (IIS) 7.0. The Site element is a child of the Sites entry in the ServiceDefinition.csdef file. If you are upgrading an existing web application to the new schema, you need to add the Sites node. This allows your application to take advantage of the full IIS feature set.
|The Site element is only available by using the Windows Azure SDK version 1.3 or above.|
For additional information about how IIS manages sites, see Configure a Web Server to Serve Content (IIS 7.0).
Open the ServiceDefinition.csdef file. Locate the Sites element, and then add Site element inside the Sites node as follows:
<Site name="<name of the site>" physicalDirectory=”<path to the site content>”></Site>
Within the Site node, add a Bindings element as follows:
<Bindings> <Binding name="<name of the binding>" endpointName="<name of the endpoint to bind to>” hostHeader=”<the URL of the web site>”/> </Bindings>
The following sample XML code shows a configuration for a site called Web, which is located in the SampleWebApp directory.
<WebRole name=”SampleWebApp”> <Sites> <Site name="Web" physicalDirectory=”..\SampleWebApp”> <Bindings> <Binding name="HttpIn" endpointName="HttpIn" hostHeader=”www.sampleapp.com”/> </Bindings> </Site> </Sites> <InputEndpoints> <InputEndpoint name="HttpIn" protocol=”http” port=”80” /> </InputEndpoints> …