Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure cloud service - Does VIP swap cause OnStop() to be invoked?

I have an Azure cloud service with a web and a worker role. When an Azure cloud service is stopped, the OnStop() method is invoked.

On a VIP swap, does it call the same OnStop() method on the outgoing service deployment as soon as the VIP swap is requested? http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleentrypoint.onstop.aspx

Also, what is the order of events during the VIP swap? Presumably, the worker OnStart() method of the new deployment is run at some point, but is this before the OnStop() of the outgoing deployment? I am trying to understand whether the two worker role versions (incoming and outgoing deployment) will be running concurrently, or whether there will be a short gap in worker role service.

like image 227
Rob Potter Avatar asked Mar 11 '13 09:03

Rob Potter


People also ask

What is VIP swap in Azure?

VIP swap is a great way for you to implement Blue-green deployments using Azure Cloud Services and Octopus Deploy. The typical process is to: Deploy a fully configured application into the "staging" slot in Azure. Run manual/automated tests on your "staging" slot.

What is swap in Azure?

Auto Swap. You can choose to swap automatically to a slot when there is a new version of your app in a deployment slot – this is called Auto Swap. Simply enable it in the Application Settings of the deployment slot: Swap with Preview. You can choose to swap with a preview when you perform a swap from the Azure Portal.

How many slots are available under Azure cloud service?

Azure Cloud Service provides two slots (1) Production and (2) Staging.


1 Answers

To the best of my knowledge, when you perform VIP swap changes happen at the router/firewall level and not at the cloud service level. Your cloud service keeps on running and OnStop() event is not fired. As mentioned in the documentation here: http://msdn.microsoft.com/en-us/library/windowsazure/hh386336.aspx

When the service is promoted to production, the VIP and URL that were assigned to the production environment are assigned to the deployment that is currently in the staging environment, thus “promoting” the service to production. The VIP and URL assigned to the staging environment are assigned to the deployment that was in the production environment.

like image 184
Gaurav Mantri Avatar answered Oct 02 '22 15:10

Gaurav Mantri