Question

Our Windows Azure roles need to know programmatically which datacenter the roles are in.

I know a REST API ( http://msdn.microsoft.com/en-us/library/ee460806.aspx) return location property. And if I deploy to, let’s say, West US, the REST API returns West US as location property. However, if I deploy to Anywhere US, the property is Anywhere US. I would like to know which datacenter our roles are in even if location property is Anywhere US.

The reason why I ask is our roles need to download some data from Windows Azure storage. The cost of downloading data from the same datacenter is free but the that of downloading data from the different datacenter is not free.

Was it helpful?

Solution

It is a great question and I have talked about it couple of time with different partners. Based on my understanding when you create your service and provide where you want this service to location ("South Central US" or "Anywhere US"), this information is stored at the RDFE server specific to your service in your Azure subscription. So when you choose a fixed location such as "South Central US" or "North Central US" the service actually deployed to that location and exact location is stored however when you choose "Anywhere US", the selection to choose "South Center" or "North Central" is done internally however the selected location never updated to RDFE server related to your service.

That's why whenever you try to get location info related to your service in your subscription over SM API or Powershell or any other way (even on Azure Portal it is listed as "Anywhere US" because the information is coming from same storage), you will get exactly what you have selected at first place during service creation.

@Sandrino idea will work as long as you can validate your service location IP address from a given IP address range published by Windows Azure team.

OTHER TIPS

Two days ago Microsoft published an XML file containing a list of IP ranges per region. Based on this file and the IP address of your role you can find in which datacenter the role has been deployed.

<?xml version="1.0" encoding="UTF-8"?>
<regions>
  ...
  <region name="USA">
    <subregion name="South Central US">
      <network>65.55.80.0/20</network>
      <network>65.54.48.0/21</network>
      ...
    </subregion>
    <subregion name="North Central US">
      <network>207.46.192.0/20</network>
      <network>65.52.0.0/19</network>
      ...
    </subregion>
  </region>
</regions>

Note: It looks like the new datacenters (West and East US) are not covered by this XML file, which might make it useless in your case.

I had some services deployed in Anywhere US and in order to find out which data centre it was deployed in I had to log a support call with Microsoft. They were helpful and got me the information but even they had to go away and look it up. As a result of this I would never use and the the "Anywhere ..." locations. Knowing which data centre your services are running in is very important for knowing where to deploy things like SQL Azure and service bus which don't support affinity groups and don't have an Anywhere option.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top