Q37. Service Configuration and service definition files?
As soon as you create a cloud service application, two files ‘Service definition and Service configuration’ are created. These files are available in the solution explorer.
If we open ServiceDefinition.csdef you will see the code listing as shown below. The first element ServiceDefinition provides a name for the service. The Windows Azure Fabric Controller defines a contract for the cloud service using this name. The service definition file is deployed for every instance of the cloud service. Each instance is informed of each setting that exists in the file ServiceDefinition.csdef.
The next element in the ServiceDefinition file is the WebRole element and the name of the Web Role Project is mentioned.
The InputEndpoint helps the Fabric controller to configure ports and protocols for the service. For the web role, the protocol is http and port is 80. The ConfigurationSettings element contains names of the settings and not the values.
The settings which exist in the service definition file can only be set with values in the service configuration file, which means if settings do not exist in the service definition file, we cannot assign values in the service configuration file.
The below Figure is the service configuration file and values of the settings can be seen here. The service configuration file includes number of instances for each role and SSL certificates associated with the service.
See More Questions and Answers on - Azure Cloud Services (cont..)