Reputation: 28228
I have a web service hosted on azure as a web role. In this web role I override the Run() method and perform some db operations in the following order to basically act as a worker role.
go to blob storage to pull a small set of data.
Cache this data for future use.
Kill some blobs that are too old.
Thread.Sleep(900000);
Basically the operation repeats every 15 minutes in the background. It runs fine when I run on DevFabric but when deployed the azure portal get stuck in a loop of stabilizing role and then preparing node.
Never actually starting up either instance. I have enabled diagnostics and it isn't showing me anything to suggest there is a problem. I'm at a loss for why this could be happening.
Upvotes: 0
Views: 243
Reputation: 28228
I don't typically like to answer my own question when someone else has made an effort to help me however I feel that the approach I used to solve this should be documented.
I enabled intellitrace when deploying to Azure and I was able to see all the exceptions being thrown and investigate the cause of the exceptions.
Intellisense was critical in solving my deployment issues. I would recommend it to anyone seeing an inconsistency between deploying devfabric and deploying to azure.
Upvotes: 0
Reputation: 71120
I would suggest moving this code to Run()
. In OnStart()
, your role instance isn't yet visible to the load balancer, and since you're introducing a very long (ok, infinite delay) into OnStart()
, this is likely why you're seeing the messages about the role trying to stabilize (more info on these messages are here.)
Upvotes: 1
Reputation: 15860
Sounds like an error is being thrown in the OnStart. Do you have any way of doing try/catch around the whole function and dumping the error into an EventViewer? From there you would be able to remote into the instance and investigate the error
Most likely your configuration deployed to cloud is different from the one running in an emulator (SQL Azure firewall permissions, pointers to Local Dev storage instead of ATS, etc). Also, make sure that your diagnostics is pointing to a real Azure account instead of local Dev storage.
Upvotes: 1