Reputation: 307
We analyzed the managment APIs but we are not able to find an API for finding a Azure VM location.Azure VM location is equivalent to its cloud service location?
Upvotes: 0
Views: 61
Reputation: 136206
Since to create a Virtual Machine Windows Azure automatically creates a cloud service (and hosts that VM in that), you could make use of Get Hosted Service Properties
functionality to find the location and that would be the location of your VM. If you created a VM using a location, then this should be sufficient.
However if you created a VM using an affinity group, you won't get location in that API call but you'll get an affinity group. In this case, you can call Get Affinity Group Properties
and get the location of that affinity group and that would be the location of your VM.
Upvotes: 1