Skip to content

Instantly share code, notes, and snippets.

@gregjhogan
Last active October 29, 2018 21:34
Show Gist options
  • Select an option

  • Save gregjhogan/2cffbd14cf88d8a6b1aad0ef8b53111b to your computer and use it in GitHub Desktop.

Select an option

Save gregjhogan/2cffbd14cf88d8a6b1aad0ef8b53111b to your computer and use it in GitHub Desktop.
Azure VM extract tag value
$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