问题描述
您好,
我正在尝试使用以下cmd在VNET内创建新子网:
New-AzVirtualNetworkSubnetConfig -Name DEV-VNET-FIN-IND -AddressPrefix 10.2.1.0/16
New-AzVirtualNetworkSubnetConfig -Name DEV-VNET-FIN-IND -AddressPrefix 10.2.1.0/16
Cmd成功完成,但没有子网可见。
Cmd complete successfully, but no subnet is visible.
此外,此cmd不接受输入到VNET内的链接子网。 ARM如何知道它在哪个VNET上创建子网?
Moreover this cmd doesn't take input to link subnet within VNET. How ARM know under which VNET it has to create the subnet?
推荐答案
您需要使用"Add-AzVirtualNetworkSubnetConfig"和"Add-AzVirtualNetworkSubnetConfig"。命令。
You need to use "Add-AzVirtualNetworkSubnetConfig" command.
如果要将子网添加到现有VNET,则需要在变量中获取VNET详细信息并在此命令中使用它。
If you are adding a subnet to the existing VNET, you need to get the VNET details in a variable and use it in this command.
以下是参考文档: https://docs.microsoft.com/en-us/powershell/module/azurerm.network/add-azurermvirtualnetworksubnetconfig?view = azurermps-6.13.0
Here is the reference Document: https://docs.microsoft.com/en-us/powershell/module/azurerm.network/add-azurermvirtualnetworksubnetconfig?view=azurermps-6.13.0
问候,
Msrini
这篇关于如何使用AZ Powershell模块创建子网的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!