Skip to content

Commit 8e91fbb

Browse files
committed
fixes
1 parent 7c11427 commit 8e91fbb

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

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

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,44 @@ Accelerated networking is enabled in the portal during virtual machine creation.
465465

466466
### [PowerShell](#tab/powershell)
467467

468+
1. Use [Get-Credential](/powershell/module/microsoft.powershell.security/get-credential) to set a user name and password for the VM and store them in the `$cred` variable.
469+
470+
```azurepowershell
471+
$cred = Get-Credential
472+
```
473+
474+
1. Use [New-AzVMConfig](/powershell/module/az.compute/new-azvmconfig) to define a VM with a VM size that supports accelerated networking, as listed in [Windows Accelerated Networking](https://azure.microsoft.com/updates/accelerated-networking-in-expanded-preview). For a list of all Windows VM sizes and characteristics, see [Windows VM sizes](/azure/virtual-machines/sizes).
475+
476+
```azurepowershell
477+
$vmConfigParams = @{
478+
VMName = "vm-1"
479+
VMSize = "Standard_DS4_v2"
480+
}
481+
$vmConfig = New-AzVMConfig @vmConfigParams
482+
```
483+
484+
1. Use [Set-AzVMOperatingSystem](/powershell/module/az.compute/set-azvmoperatingsystem) and [Set-AzVMSourceImage](/powershell/module/az.compute/set-azvmsourceimage) to create the rest of the VM configuration. The following example creates a Ubuntu Server virtual machine:
485+
486+
```azurepowershell
487+
$osParams = @{
488+
VM = $vmConfig
489+
ComputerName = "vm-1"
490+
Credential = $cred
491+
ProvisionVMAgent = $true
492+
EnableAutoUpdate = $true
493+
}
494+
$vmConfig = Set-AzVMOperatingSystem @osParams -Linux
495+
496+
$imageParams = @{
497+
VM = $vmConfig
498+
PublisherName = "Canonical"
499+
Offer = "ubuntu-24_04-lts"
500+
Skus = "server"
501+
Version = "latest"
502+
}
503+
$vmConfig = Set-AzVMSourceImage @imageParams
504+
```
505+
468506
### [CLI](#tab/cli)
469507

470508
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)