Quantcast
Channel: Azure Virtual Machines forum
Viewing all articles
Browse latest Browse all 12545

How to get offer and sku inside a vm.

$
0
0


The company I am working for is planning to publish its software installed on a Virtual Machine on the Azure marketplace. To do this, we require to be able to access some metadata from inside the virtual machine to validate that the distributed license (a file under the file system on the VM) matches the SKU and offer of the published product. This can be done in a pretty straightforward way in AWS by using its metadata API and its product-codes field:

http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html

We would like to know if it is somehow possible to query the Azure metadata API to get the fields Offer and SKU of a machine published on the marketplace from inside the VM. We have been reading the documentation and all that we have found about querying the metadata is:
https://azure.microsoft.com/en-us/blog/what-just-happened-to-my-vm-in-vm-metadata-service/


After testing this API on a machine for testing purposes we got to:

curl http://169.254.169.254/metadata/v1/InstanceInfo

{"ID":"_<machine_name>","UD":"0","FD":"0"}


However, we have been checking the documentation and these fields really exist:

https://docs.microsoft.com/en-us/rest/api/compute/virtualmachines

Is there any way to access these fields that does not require the Azure authentication credentials?

Thanks in advance.



Viewing all articles
Browse latest Browse all 12545

Trending Articles