Shaun Xu

The Sheep-Pen of the Shaun



Shaun, the author of this blog is a semi-geek, clumsy developer, passionate speaker and incapable architect with about 10 years’ experience in .NET and JavaScript. He hopes to prove that software development is art rather than manufacturing. He's into cloud computing platform and technologies (Windows Azure, Amazon and Aliyun) and right now, Shaun is being attracted by JavaScript (Angular.js and Node.js) and he likes it.

Shaun is working at Worktile Inc. as the chief architect for overall design and develop worktile, a web-based collaboration and task management tool, and lesschat, a real-time communication aggregation tool.


My Stats

  • Posts - 122
  • Comments - 622
  • Trackbacks - 0

Tag Cloud

Recent Comments

Recent Posts


Post Categories


In Windows Azure, when we published a cloud service, or a virtual machine, it will provide a public virtual IP (VIP) address and a DNS name to us. For example, when I created a new cloud service I need to provide the name, which is the public URL prefixing of it. Worldwide azure will provide [name] while China azure will provide [name] This URL will never been changed until we delete the cloud service regardless if anything we deployed in it or not. So it’s very stable that we can use to visit and bind with other external service, such as our DNS server through CNAME and some web services. But the public IP address we got was not as stable as this URL. If we need to use this VIP in our application we need to be very carefully since it might be changed out of our expectation.

I knew that the VIP might be changed in some cases, but I just dig into it once I got a requirement from a customer who need to bind their SMS service with the VIP of their cloud service. The communication between the SMS service and integrated application was socket, which means it only allow IP binding. And since they have a very strict firewall rule and change policy it would be very hard and time consuming to change the binding IP once it had been configured. So our target is to work out a plan to minimize the VIP changes.


VIP Grant, Keep and Release Policy

In the MSDN page (here) it said

The VIP of a cloud service is allocated when you first deploy it to Windows Azure in a particular environment, such as the Production environment. The VIP doesn’t change unless you delete the deployment explicitly or it is implicitly deleted by the deployment update process.

Well this is a little bit general and I would like to explain more about when the VIP would be granted, kept and released. I will use cloud service as the example, and the virtual machine would be very similar.

When we created a new cloud service, we specified the region, name and then Windows Azure provided a public URL to us. But at this moment since there is no deployment in the cloud service, there is no VIP assigned to it.


Once we deployed a package, regardless if it’s web role or worker role, regardless if you specified a public endpoint or not, Windows Azure will assign an internal IP address and a public IP address. They will be linked in the cloud service load balancer. The public address is the Virtual IP (VIP) we are talking right now.

For example, once we deployed a role with one instance, there will be an internal IP assigned to that virtual machine. In this case it’s Then the load balancer will received a VIP assigned, in this case it’s, and linked with the virtual machine.


If we increase the instance count of this role, windows azure will create another virtual machine and host our role, assigned a new internal IP. And it will be linked to the load balancer with the existing VIP. So that in this case, the incoming request will arrive at the VIP, then be routed to one of the instances.

Also, if you update the package (application) you deployed in the cloud service, it will NOT cause the VIP changed as you still make the deployment exists on the instances.


The VIP will NOT be changed if any of the instance was crashed, reallocated or hard failure. Windows Azure will create another instance in cases above, deploy the application and link the new instance to the load balancer. So user can still visit it through the VIP. Furthermore, VIP will NOT be changed even though all instances are crashed at the same time.

This will only be happened if you specifically assign all instances in one fault domain.


But, if you removed the deployment from the cloud service, Windows Azure will release all instances you have, then release the VIP the load balancer has. This is the only way you get your VIP lost.



How to Keep My VIP

Based on the description above, if we keep the deployment exists in our cloud service, we will never loss our VIP. This should be very easy if the application is running on Windows Azure. Just make sure not delete the deployment, the VIP will be stable.

But if we wanted to update our application, which means deploy a new version in the cloud service, what we should do to ensure the VIP will not be changed? So let’s have a look on how to do it through Visual Studio.

Firstly I created a cloud service and deployed a web role. Then we can see the VIP was assigned from the portal.


Then in Visual Studio we trigger another deployment. Just make sure that in the publish wizard we have the “Deployment update” checked and “Delete deployment on failure” unchecked. This means

1, Deployment the package by updating on the existing deployments, instead of deleting the exist deployment and redeploy the new one.

2, Do not delete the deployment if this new one was failed.


Also, clicked the “Settings” link next to the “Deployment update” box and make sure the “If deployment can’t be updated, do a full deployment” is unchecked. This ensures that, never do a full deployment (delete and redeploy) even though failed or not possible.


After confirmed these configuration, we can start the deployment and the VIP was not changed as you see below.


In Visual Studio Windows Azure Activities Log window, we can see that the package was been uploaded but there’s not step for virtual machine creation. This our deployment was safe and the VIP was not changed.


If we unchecked the “Deployment update” setting and trigger an new one, the log window will be like this. And we will find that the steps for virtual machine creation, starting, etc..


This means Visual Studio deleted our existing deployment and the VIP was lost.


And the good news was, the VIP will never been changed even though

- The instance count was changed (increased or decreased).

- The VM size was changed.

- The role was changed (added, removed).

- The guest OS was changed.

- The endpoint was changed (public or internal, added or removed).


More Stable VIP Solution

Even though we knew that the VIP will not be changed unless the deployment was deleted, we still might need some architecture consideration to make the VIP more stable.

For example, the case I mentioned at the beginning of this post, if we need to bind our application with some external service with IP and it’s very difficult to change the binding, we need to do more to ensure the VIP will not be changed even though we deleted the deployment.

The solution is, we need to firstly identify the minimum component related with the external service, and separated it into a dedicate cloud service.


With this architecture, we can bind the VIP of the “stable” cloud service to the external service, and the main logic of our application will be in another “dynamic” cloud service. In this way the deployment of the “stable” cloud service almost never been changed since it only contains the minimum logic to communicate with the external service. For example in my case, it only contains the logic to send SMS.

Then we can update our application, change the code, redeploy and even delete the deployment in the “dynamic” cloud service. The VIP of this cloud service might be changed, but it will not affect the “stable” one.




In this post I described the policy Windows Azure grand, keep and release the Virtual VIP of a cloud service. And I also explained how to make sure the VIP will not change when publishing through Visual Studio. And finally I introduced an architecture solution to make the sensitive VIP more stable even though the main application cloud service VIP was changed.


Hope this helps.


All documents and related graphics, codes are provided "AS IS" without warranty of any kind.
Copyright © Shaun Ziyan Xu. This work is licensed under the Creative Commons License.


Gravatar # re: Plan to Minimize VIP Changes in Windows Azure
Posted by Tiberiu on 10/19/2013 5:25 PM
Great post, great details ! Answered my questions about azure VIP behavior.
Gravatar # re: Plan to Minimize VIP Changes in Windows Azure
Posted by Tasmini on 6/26/2015 12:36 AM
This blog is solely amazing, I thought I knew a lot, however, I’m so improper, like the old saying, the more you already know, the more you find out how little you know. Thanks for the info. CommodityOnlineTips
Gravatar # re: Plan to Minimize VIP Changes in Windows Azure
Posted by Rahjani Roya on 7/13/2015 11:05 PM
‘d say that most of us website visitors are rather endowed to dwell in a fantastic site with so many special individuals with very helpful tips. I feel very happy to have discovered your entire web pages and look forward to tons of more exciting minutes reading here. Thanks once more for everything.

I am experiencing an issue with your rss feed . Don’t know why I am not able to subscribe to it. Is there anybody getting identical rss problem? Anybody who knows kindly respond. Thanks
Gravatar # re: Plan to Minimize VIP Changes in Windows Azure
Posted by Shana on 7/25/2015 4:14 AM
Hello, nice post, It's brilliant!!! Keep on writing more stuffs like this! :-) Take a look over here to find out some interesting things.
Gravatar # re: Plan to Minimize VIP Changes in Windows Azure
Posted by Roman on 11/24/2015 10:10 PM
I am agree with all of your views. I really like this blog. Amazing tips that will give readers a more entertaining copy to read. I also love to read anything that neatly describes.
Free Bullion Tips
Gravatar # re: Plan to Minimize VIP Changes in Windows Azure
Posted by technicalstock on 4/6/2016 5:32 PM

And the good news was, the VIP will never been changed even though
- The instance count was changed (increased or decreased).
- The VM size was changed.
- The role was changed (added, removed).
- The guest OS was changed.
Gravatar # re: Plan to Minimize VIP Changes in Windows Azure
Posted by Aswin on 5/3/2016 11:14 PM
First Reserve a VIP address for the life of your Azure subscription. If you're making changes, you should be looking at VIP Swap. VIP. Swap. If you've used Windows Azure anytime since its first preview launch.
Gravatar # re: Plan to Minimize VIP Changes in Windows Azure
Posted by MCX Tips on 5/14/2016 3:36 PM
I am thinking after several days... is really necessary to use UoW and Repository patterns with Entity Framework 5 and upper? I mean, the way of use and objectives of Repository Pattern are already achieve with EF (except for those you have several data sources)... and Unit of Work is used to set individual operations... that with EF internally is achieve too... So I just want to ask if at the point of view of Architecture software design is an over engineering implement those patters or not!

I know it sounds pretty silly, but I just want to make things simplest and professionally.

MCX Trading Tips
Gravatar # Movers5th Packers and Movers
Posted by khiladi Kumar on 6/14/2016 5:46 PM
The person who is tagging along with you will help you with their suggestions and you will have some organization which will help make your shopping notice a pleasant one.

Movers and Packers India

Gravatar # re: Plan to Minimize VIP Changes in Windows Azure
Posted by Madhuri on 9/21/2016 5:02 PM
The best MCX commodity tips provider has the required financial infrastructure for appreciating their clients. Other than that, they will also offer comprehensive risk management services for investors. Staying Informed On Commodity Markets as a sensible investor, you will wish to make the most of your investments.
Gravatar # re: Plan to Minimize VIP Changes in Windows Azure
Posted by mukeshjain on 5/25/2017 3:34 PM
realy i do not know after reading your post do it many new thing or share your link with my post so more people live.manali tour package
Gravatar # re: Plan to Minimize VIP Changes in Windows Azure
Posted by sunitalakhiwal on 7/4/2017 8:06 PM
great information share by you nice to read thanks for your useful post

manali honeymoon package
Post A Comment