Microsoft Azure has the option to enable Accelerated Networking on VM's. More information on the feature can be found on here. This script that will enable/disable the function for you on existing VM's.

You can download the script from here

The script works similar to the AvailabilitySet script made by Paulo Marques which uses the possibility of exporting the ARM template of the resource group and then prepare that template for redeployment with the correct values.

During the enable/disabling of the feature, the VM itself and ALL related NIC's are deleted and re-created.

Beware that if you use a dynamic Public IP address for the VM, the public IP address will change as the VM is redeployed

These functions uses Export-AzureRmResourceGroup, which means you will have a backup of your resource group in a file called OriginalTemplate-yyyy-MM-dd_hhmmss.json to recover from any issues. Beware that this cmdlet does not export any deployed extensions and diagnostics configuration, you will need to enable it manually later on.

 

Usage

  1. Download / Unzip the modules
  2. Login to Azure using Add-AzureRMAccount.
  3. Select the right subscription (select-AzureRMSubscription)  
  4. Import the modules
    • Import-Module .\AzureRm.AcceleratedNIC.CoreHelper.psm1
    • Import-Module .\AzureRm.AcceleratedNIC.Management.psd1
  5. Get the OS information from the VM (it will be required)
  6. Run the following command to ADD Accelerated Networking to a VM:
    • Add-AzureRmAcceleratedNIC -ResourceGroupName ‘NICTEST’ -VMName ‘NICVM’ -OsType linux
  7. Run the following command to REMOVE Accelerated Networking from a VM:
    • Remove-AzureRmAcceleratedNIC -ResourceGroupName ‘NICTEST’ -VMName ‘NICVM’ -OsType linux

 

See also http://blog.azureinfra.com