How to assign public IP to existing VM

%3CLINGO-SUB%20id%3D%22lingo-sub-135790%22%20slang%3D%22en-US%22%3EHow%20to%20assign%20public%20IP%20to%20existing%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-135790%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Ei%20already%20have%20one%20VM%20running%20with%20internal%20IP.%20How%20can%20i%20assign%20public%20IP%20to%20this%20existing%20VM%20through%20powershell%20and%20GUI%20%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ERegards%2C%3C%2FP%3E%0A%3CP%3ESuhag%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-135790%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-172878%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20assign%20public%20IP%20to%20existing%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-172878%22%20slang%3D%22en-US%22%3E%3CP%3EIP%20is%20NATed.%20It%20will%20be%20not%20visible%20in%20network%20configuration.%20You%20can%20read%20public%20IP%20from%20Identity%20Metadata%20Service%2C%20if%20you%20need%20to%20read%20it%20from%20the%20application%20perspective%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Finstance-metadata-service%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-machines%2Fwindows%2Finstance-metadata-service%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-172546%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20assign%20public%20IP%20to%20existing%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-172546%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHave%20you%20assigned%20it%20to%20the%20webserver%20in%20the%20Azure%20portal%20using%20above%20steps%3F%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20yes%2C%20what%20else%20you%20are%20trying%26nbsp%3B%20to%20achieve.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPublic%20IP%20will%20not%20be%20visible%20in%20IIS.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-172449%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20assign%20public%20IP%20to%20existing%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-172449%22%20slang%3D%22en-US%22%3E%3CP%3EDo%20you%20have%20to%20do%20anythign%20else%3F%26nbsp%3B%20I%20do%20not%20see%20these%20on%20my%20server%20to%20associate%20it%20to%20the%20website%20in%20IIS.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-135903%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20assign%20public%20IP%20to%20existing%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-135903%22%20slang%3D%22en-US%22%3E%3CP%3EBelow%20link%20has%20required%20steps%20to%20do%20this%20via%20Power%20Shell.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-network%2Fvirtual-network-multiple-ip-addresses-powershell%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-network%2Fvirtual-network-multiple-ip-addresses-powershell%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-135901%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20assign%20public%20IP%20to%20existing%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-135901%22%20slang%3D%22en-US%22%3E%3CP%3EExcellent%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat%20works%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Eby%20any%20chance%2C%20do%20you%20hv%20this%20through%20powershell%20%3F%20i%20could%20create%20public%20IP%20through%20powershell%20but%20could%20not%20assign%20it%20to%20interface%20as%20we%20did%20through%20GUI%20%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-135871%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20assign%20public%20IP%20to%20existing%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-135871%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESee%20steps%20below.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20Go%20to%20your%20VM%20on%20portal.%3C%2FP%3E%0A%3CP%3E2.%20Click%20on%20the%20Networking%20under%20settings%20in%20VM%20blade.%3C%2FP%3E%0A%3CP%3E3.%20Click%20on%20the%20Network%20Interface%20in%20Networking%20blade.%3C%2FP%3E%0A%3CP%3E4.%20Click%20on%20IP%20Configuration%20under%20settings%20in%20Network%20Interface%20blade.%3C%2FP%3E%0A%3CP%3E5.%20Click%20on%20the%20IP%20configuration%20on%20the%20IP%20configuration%20blade.%3C%2FP%3E%0A%3CP%3E6.%20Select%20Enable%20under%20Public%20IP%20address%20settings.%3C%2FP%3E%0A%3CP%3E7.%20Create%20a%20New%20IP%20address%20and%20choose%20static.%20Save%20the%20IP%20address%20and%20then%20the%20IP%20Configuration.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-135805%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20assign%20public%20IP%20to%20existing%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-135805%22%20slang%3D%22en-US%22%3EHi%20Kent%20%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20for%20your%20reply%20but%20in%20my%20scenario%20I%20already%20have%20azure%20windows%20vm%20with%20internal%20ip.%3CBR%20%2F%3E%3CBR%20%2F%3ENow%20I%20want%20to%20assign%20the%20public%20static%20ip%20to%20this%20vm.%3CBR%20%2F%3E%3CBR%20%2F%3EThe%20URL%20which%20you%20are%20referring%20is%20showing%20how%20to%20deploy%20the%20vm%20from%20scratch%20with%20public%20ip.%3CBR%20%2F%3E%3CBR%20%2F%3ECan%20you%20pl%20provide%20the%20steps%20or%20powershell%20command%20to%20do%20this.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-135799%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20assign%20public%20IP%20to%20existing%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-135799%22%20slang%3D%22en-US%22%3Eyou%20need%20to%20deploy%20a%20Public%20Ip%20addresse%2C%20once%20that%20is%20complete%20you%20can%20associate%20it%20to%20a%20VM%3CBR%20%2F%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-network%2Fvirtual-network-deploy-static-pip-arm-portal%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fvirtual-network%2Fvirtual-network-deploy-static-pip-arm-portal%3C%2FA%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1566449%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20assign%20public%20IP%20to%20existing%20VM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1566449%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20so%20much%20for%20useful%20information%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F5130%22%20target%3D%22_blank%22%3E%40Vineet%20Arora%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
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
Highlighted
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
Highlighted
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
Highlighted

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.

Highlighted

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 ? 

Highlighted
Highlighted

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

Highlighted

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.

Highlighted

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

Highlighted

Thank you so much for useful information @Vineet Arora