3

I am developing a client-server application where I want the client (Azure VM) to send its instance ID to the server. The server will use this instance ID to link it with the corresponding VM from the list of imported Azure instances (using Azure cloud credentials).

I am facing some problems:

I didn't have this problem for AWS as I clearly get instance ID on both sides.

juvchan
  • 6,113
  • 2
  • 22
  • 35
Tyler Durden
  • 1,188
  • 2
  • 19
  • 35

3 Answers3

3

Maybe you could use something like:

curl -H Metadata:true "http://169.254.169.254/metadata/instance/compute/vmId?api-version=2017-08-01&format=text"

As described here: https://learn.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service

Yuriy Vasylenko
  • 3,031
  • 25
  • 25
1

Which instance ID is this? (i.e. how do you get the list of ID's and what is their format?) Is it the one mentioned in the article below? If so, then the article below shows how to get it :).

https://azure.microsoft.com/en-us/blog/accessing-and-using-azure-vm-unique-id/

Neil Sant Gat
  • 857
  • 6
  • 10
-1

How are You acquiring this data, by means of which tools (xPlat Cli, PowerShell, MAML, REST API...?) maybe look here too https://azure.microsoft.com/en-us/blog/accessing-and-using-azure-vm-unique-id/

techmike2kx
  • 495
  • 2
  • 2
  • Thanks techmike2kx. I have read the article. I get this VM unique ID by running the Powershell command. However, when I make an Azure API call using the C# SDK, I don't get this VM ID. Instead, I just get instance name and Private ID. So I am still unable to form the link. – Tyler Durden Jan 18 '16 at 21:23