How to assign public IP to existing VM

Brass Contributor

Hi,

 

i already have one VM running with internal IP. How can i assign public IP to this existing VM through powershell and GUI ?

 

 

 

Regards,

Suhag

9 Replies
you need to deploy a Public Ip addresse, once that is complete you can associate it to a VM
https://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-deploy-static-pip-arm-portal
Hi Kent

Thanks for your reply but in my scenario I already have azure windows vm with internal ip.

Now I want to assign the public static ip to this vm.

The URL which you are referring is showing how to deploy the vm from scratch with public ip.

Can you pl provide the steps or powershell command to do this.

Thanks

Hi,

 

See steps below.

 

1. Go to your VM on portal.

2. Click on the Networking under settings in VM blade.

3. Click on the Network Interface in Networking blade.

4. Click on IP Configuration under settings in Network Interface blade.

5. Click on the IP configuration on the IP configuration blade.

6. Select Enable under Public IP address settings.

7. Create a New IP address and choose static. Save the IP address and then the IP Configuration.

Excellent,

 

That works,

 

by any chance, do you hv this through powershell ? i could create public IP through powershell but could not assign it to interface as we did through GUI ? 

Do you have to do anythign else?  I do not see these on my server to associate it to the website in IIS.

Hi,

 

Have you assigned it to the webserver in the Azure portal using above steps?

 

If yes, what else you are trying  to achieve.

 

Public IP will not be visible in IIS.

IP is NATed. It will be not visible in network configuration. You can read public IP from Identity Metadata Service, if you need to read it from the application perspective: https://docs.microsoft.com/en-us/azure/virtual-machines/windows/instance-metadata-service

Thank you so much for useful information @Vineet Arora