I have a VM in an old Resource Group with Address Space 192.168.0.0/16 and subnet as 192.168.2.0/24. My plan is to move the VM to different Resource Group with a different Subnet of 192.168.3.0/24 so it gets an ip of 192.168.3.5 as per the subnet.
I've created a new Resource Group with Address space 192.168.3.0/24 and subnet as 192.168.3.0/28. After that, I moved VM and its associated NIC and the NSG. I assumed that it will get New IP address range of 192.168.3.0. But the VM's NIC is still showing the old VNET is associated to it on the portal.
I tried following steps to get new Subnet IP's.
Created New NIC of new Subnet with New NSG but cannot attach the same to moved VM. There is no option to change the VNET.
I moved that VNET to new RG but I am still not able to add another NIC from Different VNET.
The Only Solution I see is to Create a new VM in new RG with a new NSG and then SWAP the OS Disk. Or Backup the VM from old VNET and Restore the VM to the new VNET.