Service Configuration File Schema
[This is prerelease documentation and is subject to change in future releases.]

The service configuration file sets configuration values for one or more role instances running within a service.

You may use a single configuration file to create multiple instances of a service. You may also use a different configuration file for each instance of a service.

The default extension for the service configuration file is .cscfg.

Sample Service Configuration File

The following code example shows a sample service configuration file for a service that includes a web role and a worker role:

<?xml version="1.0"?>
<ServiceConfiguration serviceName="MyService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
  <Role name="MyWebRole">
    <Instances count="1" />    
    <ConfigurationSettings>
      <Setting name="Setting1" value="Hello World!" />
    </ConfigurationSettings>
  </Role>
  <Role name="MyWorkerProcess">
    <Instances count="1" />    
    <ConfigurationSettings />
  </Role>
</ServiceConfiguration>

Service Configuration Namespace

The XML namespace for the service configuration file is:

http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration

Service Configuration Schema Types

The following table describes the element types of the service configuration file.

 

Element Description

ServiceConfiguration Element (Service Configuration Schema)

The top-level element of the service configuration file.

Role Element (Service Configuration Schema)

Configuration and instance settings for a role.

ConfigurationSettings Element (Service Configuration Schema)

The collection of configuration settings.

Setting Element (Service Configuration Schema)

A name/value pair that specifies a configuration setting for an instance of a role. The name of the configuration setting is declared in the service definition file.

Instances Element (Service Configuration Schema)

Specifies the desired number of role instances of the service, as well as the minimum number required for the service to operate.

See Also

Page view tracker