user2044374
user2044374

Reputation: 307

Is there any Managment API for Azure VM location?

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

Answers (1)

Gaurav Mantri
Gaurav Mantri

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

Related Questions