2 out of 11 rated this helpful - Rate this topic

Windows Azure Service Definition Schema (.csdef File)

Updated: January 9, 2013

The Windows Azure service definition file defines the service model for an application. The file contains the definitions for the roles available to a service, specifies the service endpoints, and establishes configuration settings for the service. Configuration setting values are set in the service configuration file, as described by the Windows Azure Service Configuration Schema (.cscfg File).

By default, the Windows Azure Diagnostics configuration schema file is installed to the C:\Program Files\Microsoft SDKs\Windows Azure\.NET SDK\<version>\schemas directory. Replace <version> with the installed version of the Windows Azure SDK.

The default extension for the service definition file is .csdef.

Basic service definition schema

The service definition file must contain one ServiceDefinition element. The service definition must contain at least one role (WebRole, WorkerRole, VirtualMachineRole) node. It can contain up to 25 roles defined in a single definition and you can mix role types. The service definition also contains the optional NetworkTrafficRules node which restricts which roles can communicate to specified internal endpoints. The service definition also contains the optional LoadBalancerProbes node which contains customer defined health probes of endpoints in virtual machine roles.

The basic format of the service definition file is as follows.


<ServiceDefinition name="<service-name>" xmlns=”http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition” upgradeDomainCount="<number-of-upgrade-domains>" schemaVersion=”<version>”>

  <LoadBalancerProbes>
         …
  </LoadBalancerProbes>

  <WebRole …>
         …
  </WebRole>

  <WorkerRole …>
         …
  </WorkerRole>
 
  <VirtualMachineRole …>
         …
  </VirtualMachineRole>
 
   <NetworkTrafficRules>
         …
   </NetworkTrafficRules>
</ServiceDefinition>

Schema definitions

The following topics describe the schema for the LoadBalancerProbes node, each of the role types, and the NetworkTrafficRules node.

LoadBalancerProbe Schema

WebRole Schema

WorkerRole Schema

VirtualMachineRole Schema

NetworkTrafficRules Schema

Service definition namespace

The XML namespace for the service definition file is:

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

ServiceDefinition Element

The ServiceDefinition element is the top-level element of the service definition file.

The following table describes the attributes of the ServiceDefinition element:

 

Attribute Type Description

name

string

Required. The name of the service. The name must be unique within the service account.

schemaVersion

string

Optional. Specifies the version of the Service Definition schema used. The schema version allows Visual Studio to select the correct SDK tools to use for schema validation if more than one version of the SDK is installed side-by-side.

The schema version of Windows Azure SDK 1.7 is "2012-05.1.7".

noteNote
The schemaVersion attribute is only available using the Windows Azure SDK version 1.7 or higher.

upgradeDomainCount

integer

Optional. Specifies the number of upgrade domains across which roles in this service are allocated. Role instances are allocated to an upgrade domain when the service is deployed. For more information, see Performing In-Place Upgrades.

You can specify up to 20 upgrade domains. If not specified, the default number of upgrade domains is 5.

See Also

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.
facebook page visit twitter rss feed newsletter