Azure launch task freezes

I have an Azure project with the role of MVC4, where I added a Visual C ++ 2012 Runtime Library configuration file and a script to silently install it.

The script runs and the library is installed, the only problem is that the task never ends and the installation process never ends, and then blocks the role from starting: Role instance

I connected to the server using Remote Desktop, and looking at the task manager, I see the vcredist_x64.exe process: (2 of them are actually, but I think this is normal)

Windows Server Task Manager

When I right-clicked and started the process, the deployment completed successfully and the role started.

This is a problem when my startup task is set to simple in ServiceDefinition.csdef, since it makes the server wait until the task completes to start the role. So, I set the background task, so running the script does not block the role from starting anymore, but even then the process is still running in the background and needs to be killed manually.

This script should work, and before it was with the VC ++ 2010 library (but without EXIT, but should be there to avoid blocking the role if the script returns an error code):

vcredist_x64.exe /quiet /norestart EXIT /B 0 

It does not work, so I thought that I would delete this process manually after installation:

 vcredist_x64.exe /quiet /norestart TASKKILL /F /T /IM vcredist_x64.exe EXIT /B 0 

Does not work, the process is still alive. The script really works if I run it manually on my own on the server or locally, but when Azure tries to do this during deployment, it freezes.

My startup task is defined as follows: ServiceDefinition.csdef:

 <Startup> <Task commandLine="InstallVcRedist.cmd" executionContext="elevated" taskType="background" /> </Startup> 

Logs in C:\Resources\temp\{RoleId.RoleName}\RoleTemp say that everything went well.

I can avoid role blocking by setting startup-task to background instead of simple, but this really does not solve the problem. Thanks.

+4
source share
2 answers

I understood why this happened thanks to this blog post from Steve Marx.

This problem only occurs in Windows Server 2008 SP2 , so I had to change the host to Windows Server 2008 R2 .
You can do this by changing osFamily="1" to osFamily="2" in all ServiceConfiguration files, or you can change it from the Azure portal by clicking on the service, then configure the OS at the top.

+1
source

I also needed to use this library. this is my script:

 start /w cd startup vcredist_x64.exe /q /norestart exit /b 0 

It works for me - launching is where I store the vcredist_x64.exe file.

in my servicedefinition file this is an xml line

  <Task commandLine="startup\InstallVcreditst.cmd" executionContext="elevated" taskType="simple" /> 
0
source

All Articles