ServiceConfiguration.cscfg
Get an overview of parameters of the service configuration
You use the service configuration file (.cscfg
) together with a service package when deploying a Web role in an Azure cloud service. While a lot of parameters are set automatically when the package is built, you are supposed to set up a few of them before deploying the web role.
Example:
<?xml version="1.0" encoding="utf-8"?> <ServiceConfiguration serviceName="CmsCloudService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2015-04.2.6"> <Role name="CmsWebRole"> <Instances count="1" /> <ConfigurationSettings> <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=mystorage;AccountKey=zPIELz1YoHySxoKju6ZUQhfc7UlRAACrs8K8QScpL9CvS8atWBBLeBd0DcExiB5xyz5l0SevisNVgjSN/iRKOw==" /> <Setting name="WebRole.DisplayName" value="CMS Cloud Service" /> <Setting name="WebRole.Blob.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=mystorage;AccountKey=zPIELz1YoHySxoKju6ZUQhfc7UlRAACrs8K8QScpL9CvS8atWBBLeBd0DcExiB5xyz5l0SevisNVgjSN/iRKOw==" /> <Setting name="WebRole.Blob.ContainerName" value="deployment" /> <Setting name="WebRole.Blob.ConnectionStringEncrypted" value="false" /> <Setting name="WebRole.Blob.UpdateCheckSleepInMilliSeconds" value="5000" /> <Setting name="WebRole.Blob.MaximumDownloadConcurrency" value="50" /> <Setting name="Webrole.Blob.StatusFilesTouchRateInMinutes" value="10" /> <Setting name="WebRole.Iis.AppPoolIdleTimeoutMinutes" value="60" /> <Setting name="WebRole.Iis.ManageIisConfiguration" value="true" /> <Setting name="WebRole.Iis.DeleteDefaultSites" value="true" /> <Setting name="WebRole.SmtpServer.Install" value="false" /> </ConfigurationSettings> <Certificates> <Certificate name="CertificateSlot0" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot1" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot2" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot3" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot4" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot5" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot6" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot7" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot8" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot9" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> </Certificates> </Role> </ServiceConfiguration>
The following is the overview of all the available parameters:
ServiceConfiguration
Parameter | Description | Value |
serviceName | The programmatic name of the Azure cloud service in the service package | [filled in automatically] |
xmlns | XML namespace | http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration |
osFamily | OS family | 4 |
osVersion | OS version | * |
schemaVersion | The Azure SDK version. Filled in automatically | 2015-04.2.6 |
Example:
<ServiceConfiguration serviceName="Composite.WindowsAzure.Package" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2014-01.2.3"> <!-- ... --> </ServiceConfiguration>
Role
Parameter | Description | Value |
name | The programmatic name of the web role in the service package. | [filled in automatically] |
Example:
<Role name="CmsWebRole"> <!-- ... --> </Role>
Instances
Parameter | Description | Value |
count | The number of web role instance to deploy. 1 by default. | [a number between 1 and the maximum allowed, e.g. 2] |
Example:
<Instances count="1" />
Configuration Settings (BLOB and Role)
Parameter | Description | Value |
DisplayName | The name of the web role in a specific cloud service. Used in a scaled out website deployment to distinguish between the same role running in various cloud services / data centers. | [e.g. 'Web Role - North Europe'] |
ConnectionString | The string used to connect to a blob storage. Includes the blob storage account name and access key. Used to store deployment files (in a deployment container) and website files (in a website container). Can be also encrypted. | [e.g. 'DefaultEndpointsProtocol=https;AccountName=c1websites;AccountKey={primary_access_key}'] |
ContainerName | The name of the web role deployment in a cloud service. The name also used as the name for the deployment container in a blob storage. | [e.g. 'deployment'] |
ConnectionStringEncrypted | If enabled ('true'), the connection string will be assumed encrypted. 'false' by default. | ['true' or 'false'] |
UpdateCheckSleepInMilliseconds | The timeout for update checks in the blob in milliseconds. 5000 by default. | [e.g. 5000] |
MaximumDownloadConcurrency | The maximum number of concurrent downloads. 50 by default. | [e.g. 50] |
StatusFilesTouchRateInMinutes | The timeout for the status file's checks in minutes. 10 by default. | [e.g. 10] |
Example:
<Setting name="WebRole.DisplayName" value="CMS Cloud Service" /> <Setting name="WebRole.Blob.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=mystorage;AccountKey=zPIELz1YoHySxoKju6ZUQhfc7UlRAACrs8K8QScpL9CvS8atWBBLeBd0DcExiB5xyz5l0SevisNVgjSN/iRKOw==" /> <Setting name="WebRole.Blob.ContainerName" value="deployment" /> <Setting name="WebRole.Blob.ConnectionStringEncrypted" value="false" /> <Setting name="WebRole.Blob.UpdateCheckSleepInMilliSeconds" value="5000" /> <Setting name="WebRole.Blob.MaximumDownloadConcurrency" value="50" /> <Setting name="Webrole.Blob.StatusFilesTouchRateInMinutes" value="10" />
Configuration Settings (Diagnostics)
Parameter | Description | Value |
Diagnostics.ConnectionString | The string used to connect to a blob storage. Includes the blob storage account name and access key. Used to store web role diagnostics data. Normally, it is the same as the web role deployment connection string. | [e.g. 'DefaultEndpointsProtocol=https;AccountName=c1websites;AccountKey={primary_access_key}'] |
Example:
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName={ACCOUNT_NAME};AccountKey={KEY}" />
Configuration Settings (IIS and SMTP)
Parameter | Description | Value |
AppPoolIdleTimeoutMinutes | The application pool's idle timeout (in minutes). 60 by default. | [e.g. 60] |
ManageIisConfiguration | Indicates whether the IIS will be configured automatically ('true') or manually ('false'). 'true' by default. | ['true' or 'false'] |
DeleteDefaultSites | Indicates whether the all the websites will be cleared from the IIS before setting up a new one. 'true' by default. | ['true' or 'false'] |
SmtpServer.Install | Indicates whether the SMTP service will be installed on the server. 'true' by default). | ['true' or 'false'] |
Example:
<Setting name="WebRole.Iis.AppPoolIdleTimeoutMinutes" value="60" /> <Setting name="WebRole.Iis.ManageIisConfiguration" value="true" /> <Setting name="WebRole.Iis.DeleteDefaultSites" value="true" /> <Setting name="WebRole.SmtpServer.Install" value="false" />
Certificates
Parameter | Description | Value |
name | The pre-defined names (0 to 9) for certificates. Can't be changed or removed.
| CertificateSlot{0..9} [e.g. "CertificateSlot5"]
|
thumbprint | The thumbprint of the certificate for SSL support. '8057987CA86216898EE2E06A93DAC725D8F00FE3' by default.
| [e.g. 'F182190033077DC6785CFE87FFCA1CD69346DAAA'] |
thumbprintAlgorithm | The algorithm used to generate the thumbprint ('sha1'). Can't be changed. | sha1 |
Example:
<Certificates> <Certificate name="CertificateSlot0" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot1" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot2" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot3" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot4" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot5" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot6" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot7" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot8" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> <Certificate name="CertificateSlot9" thumbprint="8057987CA86216898EE2E06A93DAC725D8F00FE3" thumbprintAlgorithm="sha1" /> </Certificates>
Note. The default thumbprint value should match that of the default certificate used when deploying the web role with this configuration.