I have a VM with 3 NICs that was deployed from the Marketplace.
I need to change the subnets and IP addresses that are currently assigned to NICs 2 & 3
I have tried using PowerShell scripts but receive this error:
Set-AzureRmNetworkInterface : Cannot change subnet of network interface /subscriptions/xxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx
4999/resourceGroups/vcfrg/providers/Microsoft.Network/networkInterfaces/vm200-eth1 while it is in use as a
secondary network interface.
Thanks,
Scott
Best Answer
I had create a VM with two NICs, NIC01(10.0.1.0/24) and NIC02(10.0.2.0/24), then I use powershell to set the azure network interface, here is my script, after the script complete, the NIC01 change to 10.0.3.0/24. It works for me.
And here is the result: