Microsoft Azure: find public ip from command line of created instance
2 answers
Taken from here
curl -s checkip.dyndns.org | sed -e 's/.*Current IP Address: //' -e 's/<.*$//'
This will give you your public outgoing IP address.
I previously set up a small API application that has credentials for Azure subscribers that browse IP subscriptions and return a JSON document with some related configuration. (and complained a bit that AWS gives you this stuff for free!)
+4
source to share
I keep shortcuts like this in my gists, which is inserted here:
azure vm show <RG_GROUP> <VM_NAME> |grep "Public IP address" | awk -F ":" '{print $3}'
This should give you the public IP address attached to the machine.
Note. I have not tested it with multiple public IPs attached to the same machine. This only applies to the main use case.
+1
source to share