title: Access Azure Public IP inside of Linux VM
body: <p>I have created a Ubuntu 16.04LTS VM on Azure and I need to access its public facing IP in order to configure the docker container I am trying to run on the server.  However, when I do the command below from the terminal in the VM:</p>
  
  <pre><code>ip addr show
  </code></pre>
  
  <p>I only get back the private local IP's and not the public facing IP.  What steps do I need to take to access the public IP from the VM's terminal?  </p>
  
  <p>The reason I would like to be able to script the getting of the public IP is that we are running a docker container on the VM (we are creating multiple VM's, part of a load testing framework we are developing in JMeter) and if we can script getting the IP and passing it to the docker container in the server startup script, then we would be able to automate our server startup so that the jmeter-server runs properly with the correct IP when we press start server from the Azure portal.  Without being able to access the public IP from a bash script, we would have to manually SSH into each machine and run docker and pass in the public IP as a parameter to docker to start each jmeter server, which would be much more time consuming. </p>