[This is preliminary documentation and is subject to change.]
The service definition file defines the roles available to a service, specifies the service endpoints, and establishes configuration parameters for the service. Configuration parameter values are set in the service configuration file, as described by the Service Configuration File Schema.
The default extension for the service definition file is .csdef.

Sample Service Definition File
The following shows a sample service definition file for a service that includes a web role and a worker role:
<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition xmlns ="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" name="MyService">
<WebRole name="MyWebRole">
<LocalStorage name="WebRoleCache" sizeInMb="1"/>
<ConfigurationSettings>
<Setting name="ConfigSetting1"/>
<Setting name="ConfigSetting2"/>
</ConfigurationSettings>
<InputEndpoints>
<InputEndpoint name="HttpIn" port="80" protocol="http"/>
</InputEndpoints>
</WebRole>
<WorkerRole name="WorkerRole" entrypoint=" MyService.EntryPoint.WorkerRole">
<LocalStorage name="WorkerRoleCache" sizeInMb="1"/>
</WorkerRole>
</ServiceDefinition>

Service Definition Namespace
The XML namespace for the service definition file is:
http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition

Service Definition Schema Types
The following table describes the element types of the service definition file.

See Also