Skip to content

Commit 5977638

Browse files
committed
fixes
1 parent d35c2c0 commit 5977638

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

articles/virtual-network/create-virtual-machine-accelerated-networking.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,34 @@ $imageParams = @{
503503
$vmConfig = Set-AzVMSourceImage @imageParams
504504
```
505505

506+
Use [Add-AzVMNetworkInterface](/powershell/module/az.compute/add-azvmnetworkinterface) to attach the NIC that you previously created to the VM.
507+
508+
```azurepowershell
509+
# Get the network interface object
510+
$nicParams = @{
511+
ResourceGroupName = "test-rg"
512+
Name = "nic-1"
513+
}
514+
$nic = Get-AzNetworkInterface @nicParams
515+
516+
$vmConfigParams = @{
517+
VM = $vmConfig
518+
Id = $nic.Id
519+
}
520+
$vmConfig = Add-AzVMNetworkInterface @vmConfigParams
521+
```
522+
523+
Use [New-AzVM](/powershell/module/az.compute/new-azvm) to create the VM with Accelerated Networking enabled.
524+
525+
```azurepowershell
526+
$vmParams = @{
527+
VM = $vmConfig
528+
ResourceGroupName = "test-rg"
529+
Location = "eastus2"
530+
}
531+
New-AzVM @vmParams
532+
```
533+
506534
### [CLI](#tab/cli)
507535

508536
Use [az vm create](/cli/azure/vm#az-vm-create) to create the VM, and use the `--nics` option to attach the NIC you created. Make sure to select a VM size and distribution that's listed in [Windows and Linux Accelerated Networking](https://azure.microsoft.com/updates/accelerated-networking-in-expanded-preview). For a list of all VM sizes and characteristics, see [Sizes for virtual machines in Azure](/azure/virtual-machines/sizes).

0 commit comments

Comments
 (0)