About Affinity Groups for Virtual Network
Updated: April 25, 2013
Affinity groups are the way to group the services in your Windows Azure subscription that need to work together in order to achieve optimal performance. When you create an affinity group, it lets Windows Azure know to keep all of the services that belong to your affinity group running at the same data center cluster. For example, if you want to keep the services running your data and your code together, you would specify the same affinity group for those services. That way, when you deploy those services, Windows Azure will locate them in a data center as close to each other as possible. This reduces latency and increases performance, while potentially lowering costs.
Affinity groups are defined at the subscription level and the name of each affinity group has to be unique within the subscription. When you create a virtual network, you can either use an affinity group that you previously created, or you can create a new one. If you have a previously created affinity group that you want to use, simply specify that affinity group when you create your new virtual network. Any previously deployed cloud services within that affinity group will automatically be designated to run in a location as close as possible to the other cloud services that you deploy to your new virtual network.