none
Cloud Service Fails to Publish with Startup Task

    Question

  • I am trying to convert my web service to use an SSL certificate. After configuring the serviceconfiguration, servicedefinition and web.config I was getting the error "The SSL settings for the service 'SslRequireCert' does not match those of the IIS 'None'."

    I did some research and found that I need to add

        <!--<security>
          <access sslFlags="Ssl, SslRequireCert" />
        </security>-->

    to my web.config. After this change I was getting a 500 error when trying to view the service in a web browser.

    I then researched and found I needed to unlock access with a startup task. I added

    <Startup>
        <Task commandLine="startup.cmd" executionContext="limited" taskType="simple" >
        </Task>
    </Startup>

    to my ServiceDefinition.csdef file. I created a new text file called "startup.cmd" to my service project. The startup.cmd contains

    appcmd unlock config /section:system.webServer/security/access

    When I try to publish my AzureCloudService in Visual Studio it takes about 10 minutes then tells me the role kept recycling and failed. I checked the logs and startup.cmd is returning a 1 indicating it failed.

    Why would this be failing? I have tried different ways of writing out the above command with no luck.

    Friday, February 05, 2016 7:30 AM

Answers

  • This was solved by saving startup.cmd as "US-ASCII - Codepage 20127" instead of "Unicode (UTF-8 without signature) - Codepage 65001" like I had read on multiple websites.
    • Marked as answer by Ozziwald Wednesday, February 17, 2016 4:59 AM
    Wednesday, February 17, 2016 1:17 AM

All replies