Prevent Azure interruption during processing

This may be a fairly simple question, but I have not yet seen a direct answer. Let's say I use the role of working Azure to complete some long-term task, let's say that it takes an hour. Now say that MS decides that the work role needs some maintenance and tries to shut it down for 30 minutes.

Is there a way to make Azure wait until this role ends to complete the service? I see the method OnStop, but it seems that you can only make things linger for a certain amount of time before you close anyway.

If this is not possible, how do you plan this for operations that take a decent amount of time and cannot be divided into smaller pieces? Will you just discard any changes made earlier and then repeat the task?

+5
source share
1 answer

You can handle the Stopping event to delay the shutdown of an instance (in soft shutdown mode). In a failure situation, you cannot prevent a stop ...

Here is a mitigation suggestion. Let them say that your task is managed in a queue. Let it pretend your message looks something like this PROCESSWIDGET|123.

. . , , , 4 , , 15 . , . , PROCESSWIDGET|123|STEP2.

... - , VM - . , , . , Blob ( - ), , , .

UpdateMessage() . MSDN.

+4

All Articles