Error while trying to change to static ip of azure virtual machine to dynamic ip
I am getting this error while trying to change to static ip of azure virtual machine to dynamic ip
Failed to save configuration changes to public IP address 'EgPractice-ip'. Error: Public IP address EgPractice-ip is in use by ipconfig /subscriptions/sub_id/resourceGroups/Practice/providers/Microsoft.Network/networkInterfaces/egpractice63/ipConfigurations/ipconfig1 and cannot be updated from static to dynamic.
To change the ip Address allocation from static to dynamic, follow the below steps:
- Stop/deallocate the VM.
- Create a New Nic in the same region of the existing VM (in the same VirtualNetwork).
- Attach the New Nic to the VM ( From the VM menu bar, choose Networking > Attach network interface. Then in Attach existing network interface, choose the network interface you'd like to attach, and select OK)
- Detach the old Nic assigned to the VM (From the VM menu bar, choose Networking > Detach network interface. In the Detach network interface dialog box, select the network interface you'd like to detach. Then select OK)
- Disassociate the Ip Address from the old Nic
- In the Ip Address menu bar, choose configuration > change the IP address assignment to Dynamic and click on Save.
- Associate the new Dynamic Ip address to the old Nic & attach the old Nic back to VM.
- Now, Dettach the New Nic & Save the changes accordingly.
- Start the VM.