Journey to ARM – Part V – Adding an external IP to an existing VM

Differently from the classic model, when you create a VM it won’t have an external IP to access your VM (if you created it using the portal, yes, it will do it for you). In my case, I have migrated my VMs from the classic model using the method described in my previous articles, so, no external IP for me. However, you may want to temporarily enable access to that VM.

So, without further delay, here’s how you do it.

First, as usual, some variables:


Then, create the actual external IP:


Next, you need to assign the IP to the NIC:


And let us not forget about security. I will create a Network Security Group, create rules to allow RDP and deny everything else from the Internet and assign it to the NIC:


Once applied, it should look like this:


Yes! It will take a minute, no downtime.

Once you are done, you might want to remove the IP and Network Security group, if you want.


You can find the script here.

Hope this helps!

Leave a Reply

Your email address will not be published. Required fields are marked *