Skip to content

Change the network interface of a VM in Azure

March 8, 2017

I got help here:

What to do:

  1. Dissociate your public ip from your old network interface. Choose the public ip and click “Dissociate”.
  2. Create your new network interface.
  3. Then associate the public ip with the new network interface.
  4. Get the resource id of both the old and new network interface in Azure portal: Choose the Network interface -> Properties -> RESOURCE ID
  5. Then run the following Azure-PowerShell-command:

Get-AzureRMVM -ResourceGroupName [RESOURCE-GROUP] -Name [MACHINE-NAME] | Remove-AzureRmVMNetworkInterface -Id “[RESOURCE-ID-OLD-NI]” | Add-AzureRmVMNetworkInterface -Id “[RESOURCE-ID-OLD-NI]” | Update-AzureRmVM

Advertisements

From → Azure

One Comment
  1. Hi Hans !
    there is a reason to Add-AzureRmVMNetworkInterface -Id “[RESOURCE-ID-OLD-NI]”
    It is something like [RESOURCE-ID-NEW-NI] ?
    Did you ever try this with VMs in an availability set ?

    Thanks for your notes.

    Erwan

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: