使用以下PowerShell命令,将网络接口的IP配置更改为使用静态私有IP地址:
$nic = Get-AzNetworkInterface -ResourceGroupName -Name
$nic.IpConfigurations[0].PrivateIpAllocationMethod = "Static"
$nic.IpConfigurations[0].PrivateIpAddress = ""
Set-AzNetworkInterface -NetworkInterface $nic
请注意替换,和为您的网络接口的资源组名称,名称和私有IP地址。然后使用此命令验证更改是否生效:
Get-AzNetworkInterface -ResourceGroupName -Name
如果命令的输出包含您指定的私有IP地址,则表示更改已成功应用。