Azure Resource Manager

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:

image

Then, create the actual external IP:

image

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

image

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:

image

Once applied, it should look like this:

image

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.

image

You can find the script here.

Hope this helps!

Leave a Reply

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