In any Azure instance I can easily fetch instance meta data from IMDS urls like below-
curl -H 'Metadata: true' http://169.254.169.254/metadata/instance?api-version=2017-12-01&format=text
But when I am trying the same from Azure Stack, I am getting following error in response of every metadata url request-
Error Response: {"Message":"Error in config data"}
How can I get information like VM Id, Container Id, Resource Group Name etc. in Azure Stack Instance?
Azure Stack doesn't support Azure Instance Metadata Service.
https://learn.microsoft.com/en-us/azure-stack/user/azure-stack-vm-considerations