如何使用AZ Powershell模块创建子网 [英] How to create Subnet using AZ Powershell Module

查看:184
本文介绍了如何使用AZ Powershell模块创建子网的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在尝试使用以下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?




推荐答案

您好Hasin, 

Hi Hasin, 

您需要使用"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模块创建子网的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆