Last active
October 29, 2018 21:34
-
-
Save gregjhogan/2cffbd14cf88d8a6b1aad0ef8b53111b to your computer and use it in GitHub Desktop.
Azure VM extract tag value
This file contains hidden or 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
| $TAG_NAME=??? | |
| curl -s -H 'Metadata:true' 'http://169.254.169.254/metadata/instance?api-version=2017-08-01' | jq '.compute.tags' | sed -e 's/"/;/g' | sed -e "s/.*;${TAG_NAME}:\(.*\);.*/\1/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment