4
votes

I have a very weird issue deploying an azure cloud Service. I have 1 Web Role with 5 instances and 1 Cache Role with 2 instances.

When I deploy my MVC 5 WebRole from the Azure Portal, deploying starts on the first web instance, then it tells me that the "The role could not be started" due to an error and stops processing the other instances. I did an RDP to the failed instance and truly the MVC application throws an error that it can't find a certain view file "The layout page "..." could not be found at the following path", even though the view in the path specified does exist. So I did an iisreset and the application worked. after I manually fixed the issue the deployment continues to the next instance and the failed instance becomes "Ready".

Anyone has an idea why things don't deploy smoothly anymore or why an iisreset is necessary?

This is relatively recent, around a month.

My environment is:

  1. .NET Framework 4.5.1
  2. MVC 5
  3. Azure SDK 2.4 for VS 2013

Thanks for the help.

1
Does your app run successfully locally in the emulator? Have you tried both the express and full emulators? For your scenario, you should be using the full emulator but I'd start with the express first since it will load faster.David Peden
Ya, it works perfectly on both emulatorsTamim Al Manaseer
How are you deploying your app? Is it possibly a permissions issue with the account under which the worker process is running?David Peden
Pretty simple actually, I use the default IIS AppPool settings and identity. I upload a package to the blob storage and update the service from this package, using the web portal.Tamim Al Manaseer
This is rather strange. I assume you are targeting OS Family 4. If not, do so. As last resort, try running the web role in elevated mode: msdn.microsoft.com/en-us/library/azure/gg557553.aspx - Runtime element, executionContext attribute. Running in elevated should solve any permissions. But I am more wondering whether you have a race condition - Web role instances trying to access Cache before it is fully ready.astaykov

1 Answers

1
votes

FINALLY!! I found the issue and fixed it.

I had a Local Storage Resources to store temporary files and local file caches for certain components, and was configured to reset on role restart. One of the components (Lucene.NET for azure) was locking the files in that local storage, causing the problem on deployment that needed to to IIS reset to release the lock.

I configured the component to cache the files on Windows temp storage instead of the Local Resource and things worked out.