无法在 Azure 中使用 Powershell 创建资源
Unable to Create Resource with Powershell in Azure
有人能告诉我为什么我每次尝试在 Azure 中使用 Powershell 创建 NIC 时总是收到图像中显示的错误吗?
谢谢
您不是在创建网络接口,而是在尝试获取一个不存在的网络接口。要创建 NIC,请使用以下过程:
# Get the Virtual Network
$VNET = Get-AzureRmVirtualNetwork -Name ‘Demo-vnet’ -ResourceGroupName ‘Demo’
# Get the Subnet Id
$SubnetID = (Get-AzureRmVirtualNetworkSubnetConfig -Name ‘default’ -VirtualNetwork $VNET).Id
# Create the Network Interface
New-AzureRmNetworkInterface -Name "NICFW" -ResourceGroupName "AdatumRG" -Location "East Us" -SubnetId $SubnetID
相应地更改变量并确保 -Location 参数与您的 VNet 位置匹配。
有人能告诉我为什么我每次尝试在 Azure 中使用 Powershell 创建 NIC 时总是收到图像中显示的错误吗?
谢谢
您不是在创建网络接口,而是在尝试获取一个不存在的网络接口。要创建 NIC,请使用以下过程:
# Get the Virtual Network
$VNET = Get-AzureRmVirtualNetwork -Name ‘Demo-vnet’ -ResourceGroupName ‘Demo’
# Get the Subnet Id
$SubnetID = (Get-AzureRmVirtualNetworkSubnetConfig -Name ‘default’ -VirtualNetwork $VNET).Id
# Create the Network Interface
New-AzureRmNetworkInterface -Name "NICFW" -ResourceGroupName "AdatumRG" -Location "East Us" -SubnetId $SubnetID
相应地更改变量并确保 -Location 参数与您的 VNet 位置匹配。