Last active
April 20, 2020 21:57
-
-
Save rsponholtz/624f25ca9e919748e048ee2102629c69 to your computer and use it in GitHub Desktop.
azure metadata api examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get network info for VM | |
curl -H Metadata:true "http://169.254.169.254/metadata/instance/network?api-version=2017-08-01" | |
#get the subnet mask | |
curl -H Metadata:true "http://169.254.169.254/metadata/instance/network/interface/0/ipv4/subnet/0/prefix?api-version=2017-08-01&format=text" | |
# | |
curl -H Metadata:true "http://169.254.169.254/metadata/instance?api-version=2019-06-01" | |
#wget -cq http://jsonip.com/ -O - | jq '.' | |
#all metadata for instance, pretty printed | |
curl -H Metadata:true "http://169.254.169.254/metadata/instance?api-version=2019-06-01" | python -m json.tool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment