The specified configuration settings for Settings are invalid. Verify that the service configuration file is a valid XML file, and that role instance counts are specified as positive integers.


 

You upload a package and configuration file to Windows Azure Management Portal either to create a new service or update an existing deployment and get below error

The specified configuration settings for Settings are invalid. Verify that the service configuration file is a valid XML file, and that role instance counts are specified as positive integers.

Few reasons why you would get this error are

  1. Invalid settings in the configuration file such that does not conform to the role schema for e.g. defining VM size in the Role element which actually should be defined in csdef file.
  2. Invalid settings or values in the configuration file that does not conform to the service configuration schema for e.g. on the <?xml version="1.0"?> header missing the encoding="utf-8" attribute.
  3. Duplicate configuration settings in cscfg file.
  4. Invalid values for settings due to typos e.g. thumbprint value for a certificate may not match with the one uploaded already.
  5. Malformed or invalid XML structure for e.g. an extra closing tag “/>”.
  6. Corrupt CSCFG file, open the file in Visual Studio to confirm that the file loads correctly and looks good.

Comments (3)

  1. phdpua says:

    additional reason why it can happens, described in my solution

    http://www.codeproject.com/…/REST-API-Create-Deployment-throwing-error-BadReque

  2. Thom Puiman says:

    Thanks, this article saved my quite some time. I had a Service Configuration that had encoding="utf-16" and Azure wasn't accepting this. Until i've changed it to utf-8.

  3. Tyler Angell says:

    Hidden Characters in the thumbprint were the underlying reason for my receiving the above mentioned error.

    https://rupertmaier.wordpress.com/2014/08/21/invalid-certificate-thumbprint-in-windows-azure-webroleworkerrole/