Getting VM Size.VM region in Azure Stack Hub

Kamaraj P (kamp) 41 Reputation points
2021-12-09T10:39:22.25+00:00

Since the meta data service not avialble on Azure Stackhub as per the below link,
https://stackoverflow.com/questions/56805659/unable-to-get-instance-metadata-in-azure-stack-vm-instance

Is there a way to identify the VM size and region information when the VM deployed on Azure stack hub ? Does the Rest API will be usefule here ?
If so can you please share some pointers on this >

THanks,
Kamaraj

Azure Stack Hub
Azure Stack Hub
An extension of Azure for running apps in an on-premises environment and delivering Azure services in a datacenter.
180 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Prrudram-MSFT 22,486 Reputation points
    2022-01-04T20:27:10.997+00:00

    Hello @Kamaraj P (kamp) ,

    Upon checking with the internal team, it appears that from inside the VM without authentication this is not possible due to the lack of Azure Instance Metadata Service(IMDS) as noted in the doc. which by the way will be available in the upcoming release as a public preview in Azure Stack Hub, no specific ETA as of now.

    A user can still query Azure Resource Manager directly using Compute Resource Provider API but this requires authentication to ARM.
    Azure VM REST API

    Please "Accept as Answer" if any of the above helped so that, it can help others in community looking for remediation for the similar issues.