【发布时间】:2018-08-27 04:01:41
【问题描述】:
我正在使用 powershell 从映像在 Azure 上创建 VM。
这是我正在使用的脚本。
$UserName = "username"
$Password = ConvertTo-SecureString "password@123" -AsPlainText -Force
$psCred = New-Object System.Management.Automation.PSCredential($UserName, $Password)
New-AzureRmVm `
-ResourceGroupName "RSG" `
-Name "VMName" `
-ImageName "ImageName" `
-Location "West US" `
-VirtualNetworkName "VNName" `
-SubnetName "default" `
-Credential $psCred
-PublicIpAddressName "None" `
-OpenPorts 3389
但是,当我进入 Azure 门户并查看时,默认情况下会分配一些公共 IP。我也试过不给PublicIpAddressName属性假设,它不会分配任何IP,但它仍然在分配。
我希望公共 IP 为空。谁能帮我实现这一点。谢谢!
【问题讨论】:
-
其实“None”的意思是不指定名字,是默认值。 Azure 将为它提供一个名称。
-
@CharlesXu-MSFT,那么如何让它空白?
-
很遗憾,没有公网 IP 似乎无法创建虚拟机。
标签: azure powershell azure-virtual-machine azure-public-ip