2

I'm adding a simple startup task to my Azure Cloud Service project. The script ensures the Cloud Service does not time out on the server (see link). When I add the task to my ServiceDefinition.csdef file, my project doesn't run; it hangs forever and reads "Starting the roles for the application in the Microsoft Azure compute emulator..." in the status bar of VS. Here is my ServiceDefinition.csdef:

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="DryrunCloud" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2015-04.2.6">
  <WebRole name="MyCloud" vmsize="Small">
   <Startup>
  <Task commandLine="Startup.cmd" executionContext="limited" taskType="simple"></Task>
</Startup>
<Sites>
...

The Startup.cmd file (placed in bin folder of web role project):

REM *** Prevent the IIS app pools from shutting down due to being idle.
%windir%\system32\inetsrv\appcmd set config -section:applicationPools -   applicationPoolDefaults.processModel.idleTimeout:00:00:00

REM *** Prevent IIS app pool recycles from recycling on the default schedule of 1740 minutes (29 hours).
 %windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.recycling.periodicRestart.time:00:00:00

Any ideas?

1

1 Answer 1

2

This link ultimately helped me. When you create the cmd file in VS, for some reason it doesn't work. You have to create it outside of your solution and then add it to your project.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.