Nil Pun
Nil Pun

Reputation: 17383

Azure Role - Application startup task failed with exit code 1

I tried to include a Task as per MSDN article below: http://msdn.microsoft.com/en-us/library/windowsazure/jj154098.aspx

However I'm getting the error below on one of the instance;

Recycling (Waiting for role to start... Application startup task failed with exit code 1. [2013-04-13T11:03:22Z])

Could someone please suggest what's really happening and what's the fix if any?

Below is my cmd:

@echo off

@echo Installing "IPv4 Address and Domain Restrictions" feature 
%windir%\System32\ServerManagerCmd.exe -install Web-IP-Security

@echo Unlocking configuration for "IPv4 Address and Domain Restrictions" feature 
%windir%\system32\inetsrv\AppCmd.exe unlock config -section:system.webServer/security

And CSDF:

<Startup>
  <Task commandLine="Startup.cmd" executionContext="elevated"/>      
  <Task commandLine="startup\startup.cmd" executionContext="elevated"/>
</Startup>

Thank you

Upvotes: 1

Views: 3678

Answers (2)

QFDev
QFDev

Reputation: 9008

What you can do here is RDP into the instance and run the .CMD file manually to see if it's throwing any errors.

I received a similar error when deploying to Azure and it was caused by the startup command raising a dialogue box that required a user input. Essentially the alert box was confirming that a .dll had been registered, that's all, but it was enough to stop the deployment routine in it's tracks.

Here is the contents of my .cmd file:

chcp 1252>NUL
regsvr32 /s .\library\asppdf64.dll
regsvr32 /s .\library\aspjpeg64.dll
exit /b 0

The /s tells the service to run silently (i.e. with dialogues purged). The chcp 1252>NUL sets the code-page.

Upvotes: 3

Micha&#235;l Hompus
Micha&#235;l Hompus

Reputation: 3489

I had a similar problem once. I fixed it by adding the following to my start-up script:

exit /b 0

Without this the Azure Fabric didn't register the script as finished and it kept recycling the instance.

I see you use ServerManagerCmd.exe. This command is removed from Windows Server 2012. So make sure your role isn't deployed with the latest OS Family version.

<ServiceConfiguration ... osFamily="1" ...>

Upvotes: 5

Related Questions