## Place your virtual network into a variable. ##
$net = @{
Name = 'myVNet'
ResourceGroupName = 'myResourceGroup'
}
$vnet = Get-AzVirtualNetwork @net
## Place address space into a variable. ##
$IPAddressRange = '2404:f800:8000:122::/63'
## Add the address space to the virtual network configuration. ##
$vnet.AddressSpace.AddressPrefixes.Add($IPAddressRange)
## Save the configuration to the virtual network. ##
Set-AzVirtualNetwork -VirtualNetwork $vnet
## Place your virtual network into a variable. ##
$net = @{
Name = 'myVNet'
ResourceGroupName = 'myResourceGroup'
}
$vnet = Get-AzVirtualNetwork @net
## Place your virtual network subnet into a variable. ##
$sub = @{
Name = 'myBackendSubnet'
VirtualNetwork = $vnet
}
$subnet = Get-AzVirtualNetworkSubnetConfig @sub
## Place the IPv6 public IP address you created previously into a variable. ##
$pip = @{
Name = 'myPublicIP-IPv6'
ResourceGroupName = 'myResourceGroup'
}
$publicIP = Get-AzPublicIPAddress @pip
## Place the network interface into a variable. ##
$net = @{
Name = 'myvm569'
ResourceGroupName = 'myResourceGroup'
}
$nic = Get-AzNetworkInterface @net
## Create the configuration for the network interface. ##
$ipc = @{
Name = 'Ipv6config'
Subnet = $subnet
PublicIpAddress = $publicIP
PrivateIpAddressVersion = 'IPv6'
}
$ipconfig = New-AzNetworkInterfaceIpConfig @ipc
## Add the IP configuration to the network interface. ##
$nic.IpConfigurations.Add($ipconfig)
## Save the configuration to the network interface. ##
$nic | Set-AzNetworkInterface