Azure is giving me a headache.
I started off with a tutorial. Created a new MVC 3 project published it. Took about 9 mins then it was working fine on my production VM.
Then I tried to publish a project I've been working on (MVC 3). It has the following dependencies:
Service.dll
Domain.dll
Autofac.dll
It works fine when I debug using the emulator.
It works fine when I unzip the package and deploy it to another server.
But when I publish to Azure Production I get the following:
1:42:31 PM - Preparing deployment for Website with Subscription ID: ...
1:42:31 PM - Connecting...
1:42:35 PM - Verifying storage account '...'...
1:42:38 PM - Uploading Package...
1:44:46 PM - Creating...
1:45:56 PM - Created Deployment ID: ....
1:45:56 PM - Starting...
1:46:34 PM - Initializing...
1:46:34 PM - Instance 0 of role Website is in an unknown state
1:46:34 PM - Instance 1 of role Website is in an unknown state
1:47:06 PM - Instance 0 of role Website is creating the virtual machine
1:47:06 PM - Instance 1 of role Website is creating the virtual machine
1:47:37 PM - Instance 0 of role Website is starting the virtual machine
1:47:37 PM - Instance 1 of role Website is starting the virtual machine
1:50:13 PM - Instance 0 of role Website is in an unknown state
1:50:13 PM - Instance 1 of role Website is in an unknown state
1:50:44 PM - Instance 0 of role Website is busy
1:50:44 PM - Instance 1 of role Website is busy
1:54:31 PM - Instance 1 of role Website is restarting
1:55:02 PM - Instance 1 of role Website is busy
1:56:40 PM - Instance 1 of role Website is cycling
1:57:43 PM - Instance 0 of role Website is cycling
I've tried number of times. With no success.
Update
I forgot to mention that I have the facebook C# sdk DLLs
I've used trial and error to find that the Facebook.Web.Mvc dll is causing me issues.
It has been included inside the bin folder but still no good.
The Azure environment doesn't have all the MVC 3 assemblies. You need to make sure you reference them all in your project and set CopyLocal = true so that the assemblies get included in your Azure package. Azure will go through this infinite cycle if it can't find all the dependencies for your project.
The assemblies you need to reference are:
- Microsoft.Web.Infrastructure
- System.Web.Helpers
- System.Web.MVC
- System.Web.Razor
- System.Web.WebPages
- System.Web.WebPages.Deployment
- System.Web.WebPages.Razor
One blog I saw also mentioned needing WebMatrix.Data
, but I found I did not need this one in my project.
If you have any other assemblies you are referencing that are not part of the .NET Framework, you will also need set CopyLocal = true on those as well.
Also, make sure your Azure storage setting is NOT set to "Use development storage" when you deploy to Azure -- this will cause the same problem.
If the above doesn't solve the problem, check this site for some other possible causes.
As Brian Rogers notes the requirement for asp.net MVC assemblies and points to a good resource for reasons of role being cycling. One Additional thing can help with MVC specifically. You can right click on your Web Application Proejct and select "Add Deployable Dependcies" then select ASP.NET MVC3. This will make sure all MVC3 required assemblies are with your project when depeployed.
Set the reference attribute "copy local" to "true" for each of the references used in the project. This worked for me.
I ran into a similar issue after updating my project to use Azure .NET SDK version 2.0.
The update procedure changed the configuration files but did not update the versions referenced by the projects. I solved this by manually removing the references to the old 1.8.* versions of the DLLs and then adding references to the 2.0. versions.
Please verify any third party dlls which were build for only 32 bit or 64 bit in your solution..these kind of dlls caused to the role cycling and busy..