Answered by:
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.
- Moved by Dave PatrickMVP Friday, February 5, 2016 1:41 PM
Friday, February 5, 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
-
I'd try them over here.
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights.- Proposed as answer by Mike Laughlin Friday, February 5, 2016 2:48 PM
- Marked as answer by Just Karl Friday, February 12, 2016 10:14 PM
- Unmarked as answer by Ozziwald Wednesday, February 17, 2016 4:58 AM
- Unproposed as answer by Ozziwald Wednesday, February 17, 2016 4:59 AM
Friday, February 5, 2016 1:41 PM -
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