Skip to content

Instantly share code, notes, and snippets.

@paulmey
Last active March 30, 2018 21:21
Show Gist options
  • Save paulmey/b948609072e7314ffe22e338eb1f4dc0 to your computer and use it in GitHub Desktop.
Save paulmey/b948609072e7314ffe22e338eb1f4dc0 to your computer and use it in GitHub Desktop.
displays vm info on azure
#!/bin/bash
curl -sH Metadata:true "http://169.254.169.254/metadata/instance/compute?api-version=2017-08-01&format=json"|jq '"/subscriptions/"+.subscriptionId+"/resourceGroups/"+.resourceGroupName+"/providers/Microsoft.Compute/virtualMachines/"+.name' -r
#!/bin/bash
curl -sH Metadata:true "http://169.254.169.254/metadata/instance/compute?api-version=2017-08-01&format=json"|jq 'to_entries|map([.key, .value]|@tsv)[]' -r|column -tn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment