Sunday, January 3, 2021

How to attach and detach a Public IP to an Azure Virtual Machine?

There are times you may have to detach a Public IP from a Virtual Machine to prevent access from the public internet. In this post let's understand the steps to attach and detach a Public IP for an Azure VM.

Attach the Public IP

1. Point your browser to Azure Portal

2. Go to your VM's Networking section

3. Click on the Networking Interface >> Settings >> IP configurations

4. Click on ipconfig1



5. Associate the Public IP address



6. You can create a new Public IP on this screen or select an IP that was created earlier from the drop down list box. Save the changes.



7.  Go back to the Settings >> Networking screen and verify if the Public IP was attached to the VM.



Detach the Public IP

Repeat the same process to detach the IP from the VM.

Click on Networking >> Network Interface >> IP Configurations >> ipconfig1

Click on Disassociate; Save the changes.



You can also attach/detach the Public IP via Azure CLI or PowerShell

No comments:

Post a Comment